I hit this API from the post man and receiving the unauthorized error, my app has read and write permission of the payment also, can anyone please help me to resolve this?
I hit this API from the post man and receiving the unauthorized error, my app has read and write permission of the payment also, can anyone please help me to resolve this?
Clover has a documentation page on unauthorized/401 errors. Please search for it and read it. They also have an e-commerce page that lists the required permissions.
I have all the permissions as per the document and the token also working fine in other APIs.
Whether the app should be published to access the orders/orderId/pay method ?
Here is my code
const reqData = { "ecomind": "moto", "customer": "customerId", "email": "customer_email", "expand": ["customer"] } const options = { method: 'POST', url: `https://scl.clover.com/v1/orders/${orderId}/pay`, headers: { 'accept': 'application/json', 'content-type': 'application/json', 'authorization': 'Bearer <token>', "x-forwarded-for": "49.204.141.142" }, data: reqData, httpsAgent: new https.Agent({ rejectUnauthorized: false }) }; axios .request(options)
and here is my order response { "id": "orderId", "object": "order", "amount": 4000, "currency": "USD", "created": 1723085129000, "customer": "customerId", "email": "customerEmail", "items": [ { "type": "sku", "quantity": 1, "amount": 4000, "currency": "usd", "description": "Test item 6" }, { "type": "tax", "description": "Taxes (included)" } ], "shipping": { "name": "Hemal", "address": { "line1": "Address line 1", "city": "", "state": "", "postal_code": "", "country": "" } }, "status": "created" }
Did I missed anything ?
9 People are following this question.