Creating a Charge

📘

You will need..

The private API key provided to you by ChargeAfter

Upon receiving a valid confirmation token, the merchant’s server can commit a charge via ChargeAfter’s Payment API.

If this request succeeds, a new charge is created and the financing payment is initiated.

curl --location --request POST 'https://api-sandbox.ca-dev.co/v2/post-sale/charges' \
--header 'Authorization: Bearer <private api key>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "confirmationToken": "<confirmation token>",
    "merchantOrderId": "<order id>"
}'
curl --location --request POST 'https://api.chargeafter.com/v2/post-sale/charges' \
--header 'Authorization: Bearer <private api key>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "confirmationToken": "<confirmation token>",
    "merchantOrderId": "<order id>"
}'

❗️

Keep your private API key private!

The request to create a charge uses the private API key. Requests using the private API key must be sent from your server. If any of these requests are sent from the browser, the private key will be compromised.

📘

What's Next?

  • Add a promotional widget to your product page to fully capitalize on your promotional financing options and increase conversion.
  • Add the option to apply using the Apply UI from anywhere in the website
  • Monitor, control and analyze the merchant’s financing activity via the Merchant Dashboard

What’s Next