Get order payments

I wanted to find out whether an order as already been paid by credit cart or is set to COD. I could not find information regarding payment type in the order details gotten through https://{accountName}.{environment}.com.br/api/oms/pvt/orders/{orderId}, so I hit a request to retrieve order payment transactions through https://{accountName}.{environment}.com.br/api/oms/pvt/orders/{orderId}/payment-transaction:

This endpoint returns a 200 HTTP status, but no data.
Does anyone have a hint how to get whether the order has been paid or not?

Thank you in advance.

Hi there!

That´s strange. Here it´s working. Are you using a real order in your test?
Just a note, it´s good to erase the host and the key details (even the name),

{
    "isActive": true,
    "transactionId": "****REPLACED****",
    "merchantName": "****REPLACED****",
    "payments": [
        {
            "bankIssuedInvoiceIdentificationNumberFormatted": null,
            "bankIssuedInvoiceIdentificationNumber": null,
            "parentAccountId": null,
            "accountId": null,
            "dueDate": null,
            "group": "promissory",
            "isGiftCardDiscount": null,
            "giftCardName": null,
            "giftCardCaption": null,
            "giftCardProvider": null,
            "giftCardId": null,
            "redemptionCode": null,
            "tid": null,
            "koinUrl": null,
            "url": null,
            "expireYear": null,
            "expireMonth": null,
            "cvv2": null,
            "lastDigits": null,
            "firstDigits": null,
            "cardNumber": null,
            "cardHolder": null,
            "referenceValue": 2794,
            "connectorResponses": {},
            "installments": 1,
            "value": 2794,
            "paymentSystemName": "Promissory",
            "paymentSystem": "17",
            "id": "****REPLACED****",
            "bankIssuedInvoiceBarCodeNumber": null,
            "bankIssuedInvoiceBarCodeType": null,
            "billingAddress": null
        }
    ],
    "sharedTransaction": false,
    "status": "Approved"
}

Thanks for pointing out the GDPR sensitive data in the image attached. Corrected it.
And thanks for the answer. I was using a real order in my tests. It means that the problem lies somewhere else, maybe in our server’s configuration to handle responses.
Have a nice day!

Hello!

I had a second thought about it and I believe I found the reason.

The payment information is in the main account. So you have to call the API in the main account instead of calling the franchise account. The order number in the main account doesn´t have the prefix GCB.
Or is the order from an external marketplace?

The order is from the franchise account.
I tried the payment-transaction request for the order without the GCB prefix (witout anything else changed), but that returned a 404 HTTP status.

How should the main account API be called? I haven’t found any information regarding this.
Is the URL the same? Can I use the same X-VTEX-API-AppKey - X-VTEX-API-AppToken pair that I use to fetch orders?
Or could you point me to a page in the online documentation where I could find this information?
Thank you for your help.

The url for the franchise account usually is the main account + a suffix
https://mainccountstore01.myvtex.com/api/oms/pvt/orders/ABC-123-01/payment-transaction
https://mainccountstore02.myvtex.com/api/oms/pvt/orders/ABC-123-01/payment-transaction

So in this case the url should be
https://mainccount.myvtex.com/api/oms/pvt/orders/123-01/payment-transaction

Usually the appkey is different.

Here´s the page about the franchising account.
https://help.vtex.com/tutorial/what-is-a-franchise-account--kWQC6RkFSCUFGgY5gSjdl
" * Name of the sellers: Main VTEX account + suffix"

Can you use the Admin? Check the transactions page. If it´s empty means the payment information is in another account.
" No transactions found. Please try other search terms or filter combinations."