Order Transaction API - POST Call

Tourist
6 0 0

Hi Team,
while trying the POST API for Order Transcation (/admin/api/2019-10/orders/#{order_id}/transactions.json). As part of the request payload, status field is supposed to be one of the following values : pending, failure, success, and error. But even if we provide random string as the value for status the request is being executed with status code 200.
Could any one please confirm if this is expected behaviour of Shopify?

0 Likes
Shopify Partner
1061 118 170

I think you are misusing the API. Can you share an URL with examples of payloads to POST containing this value?

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
0 Likes
Tourist
6 0 0

Hi thanks for your reply.

This is the URL we are hitting https://<store_url>/admin/api/2019-10/orders/:order_id/transactions.json.

The payload is as given below:
{
"transaction":{
"kind": "sale",
"gateway": "manual",
"status": "samplestatus",
"test": true,
"authorization": null,
"user_id": null,
"parent_id": <parent_id>,
"amount": "5.00",
"currency": "INR",
"source": "external"
}}

 

A status 200 OK is returned when the incorrect "status" value is given in the payload. Is this an expected behavior of Shopify?

0 Likes
Shopify Partner
1061 118 170

I tend to believe the field is just ignored. I don't think you can set the status through API. The status is set internally upon transaction creation as you can see in the examples here - https://help.shopify.com/en/api/reference/orders/transaction#create-2019-07

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
0 Likes