ResourcesCharges

Overview

On this page, we’ll dive into the different charge endpoints you can use to create and manage charges programmatically.

Charges are a slimmed down, more fluid, version of orders. Similar to orders, they are used to take payment for products/services rendered. Unlike orders, however, charges do not manage/handle product delivery.

This makes charges especially useful as a building block for your external project where you handle/manage product delivery manually.

On this page, we'll dive into the different charge endpoints you can use to manage charges programmatically. We'll look at how to view, create, and update charges.

Endpoints

The charge model

The charge model contains all the information about the charges stores have, including the type, code, and discount amount.

Properties

Name
idinteger
Description

(read-only) The unique identifier for the Charge object.

Name
urlstring
Description

(read-only) The checkout URL you would direct a customer to. The customer can complete the payment or claim the free item on this URL.

Name
statusstring
Description

(read-only) The current status of the charge. Possible values include PENDING, COMPLETED, VOIDED.

Name
emailstring
Description

The customer's email address. Required.

Name
referencestring
Description

(optional) An optional reference for the charge.

Name
currencystring
Description

(conditional) Three-letter ISO currency code. Required if total > 0.

Name
totalinteger
Description

(conditional) The total amount intended to be charged in the smallest currency unit (e.g., cents for USD). Required if currency is provided and the charge is not free. Must be > 0 for paid charges.

Name
return_urlstring
Description

The URL to redirect the customer back to after they complete the checkout process (successfully or not). Required.

Name
webhookstring
Description

(optional) A URL to send webhook events to for status updates regarding this charge.

Name
payment_method / payment_methods / use_all_payment_methodsstring/array/boolean
Description

(conditional) The specific payment gateway(s) for this charge. Required for paid charges. You can either pass:

  1. One payment method: "payment_method": "STRIPE"
  2. Multiple payment methods (which the customer can select from): "payment_methods": ["PAYPAL", "STRIPE"]
  3. All payment methods configured on your SellApp store: "use_all_payment_methods": true
Name
cancel_urlstring
Description

(optional) A URL to redirect the customer to if they cancel the checkout process.

Name
descriptionstring
Description

(optional) An optional description for the charge.

Name
coupon_codestring
Description

(optional) A valid SellApp coupon code to apply to the charge.

Name
created_attimestamp
Description

(read-only) Time at which the object was created.

Name
updated_attimestamp
Description

(read-only) Time at which the object was last updated.

Note

Note on Amounts: All monetary amounts (like total) are provided in the smallest currency unit (e.g., cents for USD, pence for GBP).


On this page