Reputation: 3495
Shopify mentions using their Hosted Payment SDK as their only way for implementing payment gateways for shopify. My requirement is a bit different. Here is my scenario
The customer checks out an order, then i have custom app (built by us) within shopify that customizes the checkout page and shows them a button that says "Make payment", when the user clicks on this button, they are sent out of shopify and brought to an external page that captures the order details passed during redirect, here the customer would pay for their order, after the payment is successful, the external app will call the shopify admin api and update payment status for this order, setting it to paid status, then the customer gets redirected back to shopify and the order is complete.
Using this flow, I won't have to use shopify's hosted payment SDK which requires approval and takes close to 30 for their team to get back to me.
I am new to shopify , would this be possible ? Is it possible to change order payment status using the shopify admin api ?
Upvotes: 3
Views: 1330
Reputation: 1263
In Shopify Order Rest API you can use field
financial_status
For creating new payment create order with pending status. After payment is completed change it to paid status.
The status of payments associated with the order. Can only be set when the order is created.
Important!
That means You can only change financial_status value for order that is created with this field.
Valid values:
Example with updating order status to paid:
PUT /admin/api/2021-01/orders/450789469.json
{
"order": {
"id": 450789469,
"financial_status": "paid"
}
}
You can read more on shopify Rest API Order reference page
Upvotes: 0