These docs are for v20.3.44. Click to read the latest docs for v20.3.186.

Discussions

Ask a Question
Back to All

How can I submit a cart through REST

Hi all,
I am trying to submit a payment through the https://{{URL}}/api/cart/ endpoint.
I have tried all various permutations of the comborder JSON and have had no luck.
I did try PUT which updates the cart item and POST which creates a new cart but none of those push through a CASH payment.

Below is the part I inject into the CartData. Is there a special Http Verb I should be using? Is there anything missing in the payments object?
I am really stuck.
Thanks a lot for you all of your help!
Alex
"Payments": {
"$type": "Asi.Soa.Commerce.DataContracts.RemittanceDataCollection, Asi.Contracts",
"$values": [
{
"$type": "Asi.Soa.Commerce.DataContracts.RemittanceData, Asi.Contracts",
"Amount": {
"$type": "Asi.Soa.Core.DataContracts.MonetaryAmountData, Asi.Contracts",
"Amount": 2.12,
"Currency": {
"$type": "Asi.Soa.Core.DataContracts.CurrencyData, Asi.Contracts",
"CurrencyCode": "USD",
"DecimalPositions": 2,
"ExtensionData": {
"$type": "System.Runtime.Serialization.ExtensionDataObject, System.Runtime.Serialization"
}
},
"IsAmountDefined": true
},

                "PaymentMethod": {
                    "$type": "Asi.Soa.Commerce.DataContracts.PaymentMethodData, Asi.Contracts",
                    "Message": "CASH",
                    "Name": "Main Checking Account",
                    "PaymentMethodId": "CASH",
                    "PaymentType": "CASH"
                },
                "PayorParty": {
                    "$type": "Asi.Soa.Commerce.DataContracts.CustomerPartyData, Asi.Contracts",
                    "PartyId": "18052"
                }
            }
        ]
    }