Create a new payment intent
const url = 'https://api.paygasus.com/payments/card';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"amount":1000,"capture_method":"automatic","create_token":true,"currency":"USD","description":"example","metadata":"example","stored_credential":{"initiator":"cardholder","scheduled":true,"scheme_reference_transaction_id":"example","sequence":"first"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.paygasus.com/payments/card \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "amount": 1000, "capture_method": "automatic", "create_token": true, "currency": "USD", "description": "example", "metadata": "example", "stored_credential": { "initiator": "cardholder", "scheduled": true, "scheme_reference_transaction_id": "example", "sequence": "first" } }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
A monetary amount in the currency’s minor units (e.g. cents for USD).
Example
1000Opt in to minting a reusable network token on this intent’s charge
(CommerceHub createToken). Defaults to false.
Currently supported currencies by Paygasus Pay
Example
USDStored-credential attributes (COF/CIT/MIT/Recurring) to forward on the charge. Omit for a plain one-off payment.
object
Who initiated a stored-credential transaction: the cardholder (CIT) or the
merchant (MIT). Maps to CommerceHub storedCredentials.initiator.
Whether this is a scheduled (e.g. recurring) transaction.
The issuer scheme reference from the initial transaction. Supply on a
subsequent transaction; obtained from the intent’s returned
scheme_reference_transaction_id on the initial one.
Whether this is the first time a credential is stored or a reuse of a
previously stored one. Maps to CommerceHub storedCredentials.sequence.
Responses
Section titled “Responses”Payment intent created
object
A monetary amount in the currency’s minor units (e.g. cents for USD).
A monetary amount in the currency’s minor units (e.g. cents for USD).
A monetary amount in the currency’s minor units (e.g. cents for USD).
Whether a network token was requested for this intent’s charge.
Currently supported currencies by Paygasus Pay
object
Network-token outcome of the charge, if any was returned.
object
Whether the authorization was completed via a PAN or a TOKEN.
Network-token vs PAN lookup result.
Token service provider/source (e.g. TRANSARMOR, network scheme).
Reusable token value (CommerceHub paymentTokens[].tokenData).
Issuer scheme reference returned by the processor, for chaining a
subsequent stored-credential transaction. None until the charge returns one.
If is in state ‘Created’, will be empty. status_at indicates state change occurences. Created is the initial state
Stored-credential attributes forwarded on the charge, if any.
object
Who initiated a stored-credential transaction: the cardholder (CIT) or the
merchant (MIT). Maps to CommerceHub storedCredentials.initiator.
Whether this is a scheduled (e.g. recurring) transaction.
The issuer scheme reference from the initial transaction. Supply on a
subsequent transaction; obtained from the intent’s returned
scheme_reference_transaction_id on the initial one.
Whether this is the first time a credential is stored or a reuse of a
previously stored one. Maps to CommerceHub storedCredentials.sequence.
Example
{ "amount": 1000, "amount_captured": 1000, "amount_refunded": 1000, "capture_method": "automatic", "currency": "USD", "id": "pi_card_9Z3K01ARZ3NDEKTSV4RRFFQ69G5FAV", "payment_method": { "brand": "AMEX" }, "status": "created", "stored_credential": { "initiator": "cardholder", "sequence": "first" }}Invalid request
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "param": "example", "type": "example" }}