Hey Shopify community
I am trying to get to payments.json endpoint working and it’s been a real struggle.
I have been following this guideline: https://shopify.dev/tutorials/complete-a-sales-channel-payment-with-checkout-api
My steps are as follows:
-
On the frontend the user fills out the necessary information (e.g. what items they want, their card information which is tokenized by stripe, shipping address…)
-
on the backend I create a checkout and get back the shopify_payments_account_id and the shopify checkout token
-
I use the customer information and credit card information to create a stripe customer with an attached source
-
I create a token using that stripe customer and the attached source with my shopify_payments_account_id which uses the stripe connect mechanism to create a token to pass to shopify’s payments.json endpoint
The issue is at the last step
When I call
`/admin/api/2019-04/checkouts/${token}/payments.json`
with the following body
{
"payment":{
"amount":"81.63",
"payment_token":{
"payment_data":"tok_1xxxxxxaly",
"type":"stripe_vault_token"
},
"request_details":{
"accept_language": 'en-US,en;q=0.9,fr;q=0.8,ru;q=0.7,it;q=0.6',
"ip_address": '172.26.0.3',
"user_agent": 'BATCH-API' },
"unique_token":"d792c843-0910-48b9-a53f-0c1f80870117" //this is a uuid, is that an issue?
}
}
I constantly get the error back:
'{"errors":{"request_details":"Required parameter missing or invalid"}}',
I have no idea what to do with this error message. Which field could be missing, or what is invalid?
Any help would be appreciated.
p.s.
I noticed that the payments documentation under the sales channel section went missing today. The link I used up until today (https://shopify.dev/docs/admin-api/rest/reference/sales-channels/payment) now returns a 500. The docs in the tutorial I linked above show code from the API version from 2016.