v1

latestOpenAPI 3.0.02026-07-24126202516.7 KB
Charges

Create Charge

Create a Charge. Charges require a specified Card Account or Bank Account. You may pass through an existing User, or define the user_id of the new user that will be associated with the Charge and the provided Account. The user_id can be left blank if you wish for a new user to be created for the Charge, or specified if you wish for a new User to be created with the passed user_id.

post/charges

Request body

account_idstring required

Bank Account or Card Account ID

namestring

Description of the Charge being created.

amountinteger required

The cost being charged in cents.

emailstring required

Email of the user associated with the account being charged.

zipinteger required

Postcode

countrystring required

ISO 3166-1 alpha-3 country code of the User being charged.

user_idstring

The ID of the User

fee_idsstring

A comma separated list of fee IDs to apply

currencystring

ISO 4217 alpha-3 currency code. This is an optional field and if not provided, the item will be created with the default currency of the marketplace.

retain_accountboolean

True - Enables the account to be charged in the future. False - Redacts the account after this charge.

device_idstring

Device Information for the device initiating the payment

ip_addressstring

IP Information for the device initiating the payment

custom_descriptorstring

When custom_descriptors are enabled, this is the information to appear on credit card and direct debit statements.

cvvstring

CVV / CVC

Example request

{
  "account_id": "5ef44050-4c56-0137-abdf-0242ac110002",
  "name": "Test Charge 001",
  "email": "buyer-1556505753@promisepay.com",
  "country": "AUS",
  "user_id": "buyer-1556505753",
  "currency": "AUD"
}

Response

OK

Example response

{
  "charges": {
    "id": "cb7eafc1-571c-425c-9adc-f56cb585cd68",
    "name": "Charge for Delivery",
    "state": "completed",
    "seller_fees": 400,
    "status": 22500,
    "amount": 20000,
    "dynamic_descriptor": "ASM*Samuel Seller",
    "account_id": "b49d943f-add0-4d1c-b357-0f1a8fde677c",
    "account_type": "credit card",
    "promisepay_fee": 187,
    "currency": "AUD",
    "payment_method": "charge",
    "buyer_name": "Anonymous Buyer",
    "buyer_email": "anonymous+buyer+1@assemblypayments.com",
    "buyer_country": "AUS",
    "seller_name": "Anonymous Seller",
    "seller_email": "anonymous+seller+1@assemblypayments.com",
    "seller_country": "AUS",
    "related": {
      "buyers": "064d6800-fff3-11e5-86aa-5e5517507c66",
      "sellers": "5830def0-ffe8-11e5-86aa-5e5517507c66"
    },
    "links": {
      "self": "/charges?limit=2&offset",
      "buyers": "/charges/cb7eafc1-571c-425c-9adc-f56cb585cd68/buyers",
      "sellers": "/charges/cb7eafc1-571c-425c-9adc-f56cb585cd68/sellers",
      "status": "/charges/cb7eafc1-571c-425c-9adc-f56cb585cd68/status"
    }
  }
}