Create a payment
POSThttps://app.shuttleglobal.com/c/api/instances/{instance_key}/payments
Create a new payment. The payment can be immediate or scheduled, one-time or recurring. Unless rejected prior to processing, the API request will succeed and return a payment object in a SUCCESS or DECLINE status.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Payment details object
object
"GBP"The currency in ISO format (e.g., USD)
"100.00"The payment amount as a string without commas, using ‘.’ as decimal separator.
Required in the standard case. Optional when charges is provided — if omitted,
it is derived from the sum of charges[].amount; if supplied, it must equal that sum.
"order_123"Your unique reference for the payment (e.g., order id). URL friendly string, max 64 chars (a-z0-9_-)
"Invoice 1234"Descriptive text for the payment
Unique string to prevent duplicate submissions within 24 hours
"PAYMENT"Payment action type
"ECOMMERCE"Source of the payment
"https://www.myhost.com/success"URL to redirect on successful 3D secure completion
"https://www.myhost.com/cancel"URL to redirect on 3D secure cancellation
ID of existing payment method
Payment method details. Submit the fields relevant to the payment type being used. For cards, provide card_number, card_cvc, and card_expiry at minimum. For SEPA, provide sepa_iban and sepa_account_holder_name. For ACH, provide ach_account_number, ach_routing_number, ach_account_holder_name, and ach_account_type.
object
Gateway ID to tokenise the payment method with
Pre-existing gateway token for a saved payment method
Full card PAN without formatting
/^[0-9]{13,19}$/Card security code (3-4 digits)
/^[0-9]{3,4}$/Card expiry in YYYY-MM format
/^[0-9]{4}-[0-9]{2}$/Card type (e.g., VISA, MASTERCARD)
Last 4 digits of the card number
Name on the card
CAVV cryptogram for network token or 3DS authentication
Electronic Commerce Indicator value
Token requestor ID for network tokens
Customer’s IBAN with formatting removed
Customer’s account holder name for SEPA
Customer’s account holder name for ACH
ACH account type: checking, savings or businessChecking.
ACH routing number
ACH account number
Billing address associated with the payment method
object
Country code
Address line 1
Address line 2
Address line 3
City / Town
Postcode / ZIP
State / Region
ID of existing account
Account/customer details. You can provide an existing account ID or CRM key, or create a new account by providing customer details. If an account with the same CRM key already exists, it will be used.
object
Existing account ID
Your identifier for the customer (CRM key). If an account with this key exists, it will be used
Alias for crm_key
Customer’s first name
Customer’s last name
Customer’s full name (alternative to first_name/last_name)
Company name
Customer’s email address
Customer’s phone number
CSV of tags/references for the account
Customer’s address
object
Country code
Address line 1
Address line 2
Address line 3
City / Town
Postcode / ZIP
State / Region
"ONEOFF""MONTHLY"Payment frequency for recurring payments. Cannot be used together with charges;
to use scheduled charges, omit frequency or set it to ONEOFF.
12Number of payments for recurring payments (blank = forever)
When to take first payment for recurring payments (up to 365 days future)
Days from now for first recurring payment (up to 31 days)
When to process one-time payment (up to 365 days future)
Days from now for one-time payment (up to 31 days)
Example
[ { "alt_key": "INSTALMENT_1", "amount": "100.00", "due": "now" }, { "alt_key": "INSTALMENT_2", "amount": "50.00", "due": "2026-06-01T09:00:00Z" }, { "alt_key": "INSTALMENT_3", "amount": "50.00", "due": "2026-07-01T09:00:00Z" }]Explicit schedule of charges for the contract. Use this when charge amounts or due dates vary between charges (e.g., instalment plans with irregular amounts or dates). All charges are created upfront at contract creation.
When each charge is taken:
due: "now"or a past timestamp (within the last 24 hours) — taken synchronously as part of contract creation. If the charge declines, contract creation fails and no contract is created.dueset to a future timestamp — taken asynchronously by the scheduler on the due date. The contract is created regardless of the outcome of that later payment.
To have the first charge run asynchronously, set its due to a future timestamp
(even a few minutes ahead).
Constraints:
- Cannot be combined with
frequency(must be omitted orONEOFF). - Not supported with
action: AUTH. - Each charge’s
duecannot be more than 24 hours in the past. - The top-level
amountis optional whenchargesis provided. If you do provideamount, it must equal the sum ofcharges[].amount.
A single charge on an explicitly scheduled contract. Each charge carries its own amount and due date, allowing schedules with varying amounts and irregular dates.
object
"INSTALMENT_1"Optional — your unique reference for this charge (e.g., instalment number or invoice line id). URL friendly string, max 64 chars (a-z0-9_-)
"100.00"The charge amount as a string without commas, using ‘.’ as decimal separator. Must be greater than zero.
"2026-06-01T09:00:00Z"When this charge is due. Accepts either the literal string "now", or an ISO 8601 timestamp.
"now"or a past timestamp (within the last 24 hours) — taken synchronously during contract creation. A decline blocks the whole contract creation.- Future timestamp — taken asynchronously by the scheduler on the due date. The contract is created regardless of that later payment’s outcome.
A timestamp more than 24 hours in the past is rejected.
Gateway ID to process the payment through. If not specified, the default gateway will be used
Whether to save the card for future use
Force creation of a new payment method even if a matching one already exists
Contract ID for one-time payment on existing contract
Legal entity ID or code processing the payment
Event date associated with the payment
{ "order_id": "12345", "customer_reference": "CUS-001"}Custom key-value pairs that will be stored on the contract
object
Shipping address for the order
object
Country code
Address line 1
Address line 2
Address line 3
City / Town
Postcode / ZIP
State / Region
Example
[ { "sku": "SHOE-10-BLK", "name": "Running shoes", "quantity": 2, "unit_price": 20, "total_amount": 40, "total_tax": 4 }, { "sku": "SHIPPING", "name": "Standard delivery", "quantity": 1, "unit_price": 4.99, "total_amount": 4.99, "total_tax": 0 }]The order basket. Optional, but required by BNPL providers and by some acquirers to
qualify for Level 2 / Level 3 interchange rates on commercial cards. Include every
line that makes up the payment amount, including shipping and tax lines.
A single line in the order basket.
Line items are optional, but supplying them unlocks several things depending on the gateway and payment method in use:
- Level 2 / Level 3 interchange data for commercial and purchasing cards — required by some acquirers to qualify for lower interchange rates.
- Buy Now Pay Later — BNPL providers require a basket before they will underwrite the order.
- Express checkout / wallets — the basket is shown in the wallet sheet.
- Fraud screening — basket contents are passed to the fraud provider.
Amounts and units
All monetary values are in major currency units (e.g. 29.99, not 2999) and should be
sent as JSON numbers, not strings. unit_price and total_amount are gross — they
include the tax reported in total_tax.
How the line total is derived
Most gateways treat the difference between the extended price and the line total as a discount:
discount = (quantity x unit_price) - total_amount
So for a line with no discount, set total_amount to quantity x unit_price. Where a
gateway accepts an explicit discount, total_discount is used instead.
Consistency with the payment amount
Shuttle does not reject a basket that fails to add up to the payment amount, but gateways
may. Where the basket totals less than the payment amount, some gateways (PayPal, for
example) add a balancing “Miscellaneous” line automatically. Send a complete basket
wherever possible, including shipping and tax lines.
Where line items are used for Level 2 / Level 3 interchange data, the card networks
require the breakdown to reconcile exactly — sum(total_amount) must equal the payment
amount. Where it does not (a part payment, an instalment, an amount override, a discount
that is not itemised), the interchange data is simply not sent and the payment goes through
unchanged. Line items never cause a payment to fail.
Not every field reaches every gateway. Fields are mapped to whatever the target gateway
supports and silently dropped otherwise. name, quantity, unit_price and
total_amount are the fields understood everywhere, so populate at least those.
object
"Running shoes"Display name of the item. Shown to the customer in wallet sheets and BNPL baskets, and used as the item description for Level 2/3 data. Some gateways truncate this aggressively (Authorize.Net to 31 characters, Fat Zebra to 40), so keep it short.
"SHOE-10-BLK"Your product code / SKU for the item.
PayPal only: a line item whose sku is shipping, handling or insurance
(case-insensitive) is removed from the basket and its total_amount is reported in the
corresponding PayPal order breakdown field instead of as a basket line.
"Black running shoes, UK size 10"Longer description of the item, where name is not enough. Only used by gateways that
accept a separate description field; those gateways fall back to name when this is
omitted.
2Number of units of this item.
"each"Unit that quantity is expressed in — for example each, hours, metres. Used in
Level 3 interchange data, where the card networks require it. Alphanumeric, maximum 12
characters; a longer or malformed value is replaced with each, as is an absent one.
20Gross price of a single unit, in major currency units, including tax.
40Gross total for the line, in major currency units, including tax and after any discount. See the discount formula above.
4Tax included in total_amount for this line, in major currency units. Send 0 for a
tax-free line rather than omitting the field — several gateways sum this across the
basket to report an order-level tax total.
0Explicit discount applied to this line, in major currency units. Only used by gateways
that accept a discount amount per line (CyberSource, Worldpay). Other gateways derive
the discount from (quantity x unit_price) - total_amount.
Express the discount this way rather than as a negative line item. A negative line is not forwarded as Level 2/3 data.
0.2Tax rate applied to this line, passed through unchanged. Only used by gateways that
accept an explicit rate (currently CyberSource, which expects a decimal fraction —
0.2 for 20%). Where it is omitted, gateways that need a rate derive one from
total_tax and total_amount.
Discount rate applied to this line, passed through unchanged. Only used by gateways that accept an explicit rate (currently CyberSource).
"https://example.com/products/shoe-10-blk"HTTPS URL of the product page for this item. Displayed by BNPL providers (Klarna, Affirm) in the basket they present to the customer.
"https://example.com/images/shoe-10-blk.jpg"HTTPS URL of a product image for this item. Displayed by BNPL providers (Klarna, Affirm) in the basket they present to the customer.
Hotel-specific data passed through to the payment gateway
object
Responses
Section titled “Responses”Payment created
object
Payment details
object
"pay_11842_10000"Payment identifier
"1234"Your supplied payment reference
"Invoice 1234"Payment description
"MOTO"Payment source
"PAYMENT"Payment action type
"SUCCESS"The status of the payment:
- SUCCESS - The payment was approved
- PENDING - The payment is still in progress
- DECLINED - The payment was declined
- REQAUTH - The payment requires authorization step (e.g. 3D secure)
- INVALID_PAYMENT_METHOD - Invalid payment method used
- UNRESOLVED - No conclusive approval/decline received
- UNATTRIBUTED - Success but internal recording issue
"APPROVED"Category or error message from the gateway
"ch_1GVaEEFi2CnH4uN3ouw69fw3"Gateway’s identifier for the transaction
"pi_1GVaEEFi2CnH4uN355ZdZvk5 (TEST)"Authorization code from the gateway
"REF-00010000"Customer-facing reference (e.g., BOLT-123445)
"100"Payment amount
"100"Payment amount less any refunds
"GBP"Payment currency in ISO format
When the payment was resolved
"CUSTOMER_ACTION_REQUIRED"Sub-status of the payment, present when the gateway is waiting for someone to act. CUSTOMER_ACTION_REQUIRED means the customer still has something to do - e.g. a bank transfer or Multibanco payment stays PENDING until they make the transfer or pay the voucher. MERCHANT_ACTION_REQUIRED is reserved for future use. Omitted and NO_ACTION_REQUIRED mean the same thing.
"follow_bank_transfer_instructions"Free-text description of the sub-status, e.g. follow_bank_transfer_instructions, follow_voucher_instructions or partially_funded. Descriptive only - not searchable.
"2020-04-13T00:00:00.000Z"Intended payment date. Present only when the payment was created ahead of its target date because the payment method requires gateway advance notice (e.g. SEPA/BACS/GoCardless/Stripe ACH). This is the target date, not the settlement date, and is omitted for payment methods that charge on the due date.
"GBP"Settlement currency if different from transaction currency
"100"Gross amount in settlement currency
"96.9"Net amount in settlement currency after fees
"3.1"Processing fees in settlement currency
"gw_11842_10000"Gateway used for processing
"acc_11842_10000"Associated account ID
"pm_11842_10000"Payment method ID used
"co_11842_10000"Associated contract ID
"ch_11842_10001"Processing channel
"in_11842_10000"Initiative ID
"des_11842_10000"Designation ID
"le_11842_10000"Legal entity ID
"2020-04-08T09:29:48.000Z"Creation timestamp
"2020-04-08T09:29:52.000Z"Last update timestamp
"2020-04-08T09:29:51.000Z"Processing timestamp
Gateway-specific data (varies by gateway)
object
falseWhether a tokenized payment method was used
falseWhether this is a recurring payment
"MONTHLY"Frequency for recurring payments
12Number of planned occurrences for recurring payments
"212.161.80.4"IP address of the browser that initiated the payment
Associated contract details
object
"co_11842_10000"Contract identifier
"acc_11842_10000"Associated account ID
"1234"Your reference for this contract
"100"Contract amount
"GBP"Contract currency
"Invoice 1234"Contract description
"COMPLETED"Status of the contract
falseWhether this is a recurring contract
"pm_11842_10000"Payment method ID used
"2020-04-08T09:29:48.000Z"Creation timestamp
"2020-04-08T09:29:52.000Z"Last update timestamp
"2020-04-08T09:29:48.000Z"Initiation timestamp
"2020-04-08T09:29:52.000Z"Completion timestamp
"tr_11842_10000"The last transaction ID for this contract
Frequency for recurring contracts
Number of planned occurrences for recurring contracts
Next scheduled charge date for recurring contracts
Number of charges processed for this contract
Transaction details
object
"tr_11842_10000"Transaction identifier
"PAYMENT"Transaction action type
"MOTO"Transaction source
"SUCCESS"Transaction status
"APPROVED"Status reported by the gateway
"CUSTOMER_ACTION_REQUIRED"Sub-status of the transaction, present when the gateway is waiting for someone to act. CUSTOMER_ACTION_REQUIRED means the customer still has something to do - e.g. a bank transfer or Multibanco payment stays PENDING until they make the transfer or pay the voucher. MERCHANT_ACTION_REQUIRED is reserved for future use. Omitted and NO_ACTION_REQUIRED mean the same thing.
"follow_bank_transfer_instructions"Free-text description of the sub-status, e.g. follow_bank_transfer_instructions, follow_voucher_instructions or partially_funded. Descriptive only - not searchable.
"ch_1GVaEEFi2CnH4uN3ouw69fw3"Gateway’s transaction identifier
"pi_1GVaEEFi2CnH4uN355ZdZvk5 (TEST)"Authorization code from the gateway
"REF-00010000"Customer-facing reference
"100"Transaction amount
"GBP"Transaction currency
"2020-04-08T09:29:48.000Z"Creation timestamp
"2020-04-08T09:29:52.000Z"Last update timestamp
"2020-04-08T09:29:51.000Z"Processing timestamp
"2020-04-08T09:29:51.000Z"When the transaction was resolved
"2020-04-13T00:00:00.000Z"Intended payment date. Present only when the transaction was created ahead of its target date because the payment method requires gateway advance notice (e.g. SEPA/BACS/GoCardless/Stripe ACH). This is the target date, not the settlement date, and is omitted for payment methods that charge on the due date.
Payment identifier (legacy format - use payment.id instead)
Your supplied payment reference (legacy format - use payment.alt_key instead)
Payment description (legacy format - use payment.description instead)
Payment source (legacy format - use payment.source instead)
Payment action type (legacy format - use payment.action instead)
Payment status (legacy format - use payment.status instead)
Bad request - invalid parameters
Every error has a code and a message. Some add more fields alongside them, with detail about the error.
object
The error code, for example VALIDATION_ERROR, INVALID, INVALID_REQUEST, UNAUTHORIZED, FORBIDDEN or NOT_FOUND. Program against this, not the message.
What went wrong, in words, for logs and support.
Unauthorized - invalid credentials
Every error has a code and a message. Some add more fields alongside them, with detail about the error.
object
The error code, for example VALIDATION_ERROR, INVALID, INVALID_REQUEST, UNAUTHORIZED, FORBIDDEN or NOT_FOUND. Program against this, not the message.
What went wrong, in words, for logs and support.
Example
{ "code": "UNAUTHORIZED", "message": "Unauthorised"}Was this page helpful?
What went wrong?
Thanks for telling us.