Tokenize card details for a subscription
POST {{baseUrl}}/payments
Sends payment parameters (like amount, country, and currency) together with other required input details collected from the shopper. To know more about required parameters for specific payment methods, refer to our payment method guides. The response depends on the payment flow: * For a direct flow, the response includes a pspReference
and a resultCode
with the payment result, for example Authorised or Refused. * For a redirect or additional action, the response contains an action
object.
Request Body
{"amount"=>{"currency"=>"USD", "value"=>1000}, "reference"=>"Your order number", "paymentMethod"=>{"type"=>"scheme", "encryptedCardNumber"=>"test_4111111111111111", "encryptedExpiryMonth"=>"test_03", "encryptedExpiryYear"=>"test_2030", "encryptedSecurityCode"=>"test_737"}, "shopperReference"=>"YOUR_SHOPPER_REFERENCE", "storePaymentMethod"=>true, "shopperInteraction"=>"Ecommerce", "recurringProcessingModel"=>"Subscription", "returnUrl"=>"https://your-company.com/...", "merchantAccount"=>"{{YOUR_MERCHANT_ACCOUNT}}"}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string | ||
Idempotency-Key | null | A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). |
RESPONSES
status: OK
{"additionalData":{"cvcResult":"1 Matches","authCode":"098871","avsResult":"4 AVS not supported for this card type","recurring.recurringDetailReference":"9916178934434753","recurringProcessingModel":"Subscription","avsResultRaw":"4","cvcResultRaw":"M","refusalReasonRaw":"AUTHORISED","recurring.shopperReference":"YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j","acquirerCode":"TestPmmAcquirer","acquirerReference":"8PQMP9VD896"},"pspReference":"993617895199574A","resultCode":"Authorised","merchantReference":"string"}