Use saved details
There's no need to request your customers’ card details for every payment. Instead, you can use a source ID to securely process their subsequent payments without having to re-enter their card number. It's simple, fast, and secure!
The source ID
must be one received in response to a card payment request. An ID received in response to a network token payment request will not work.
Request a payment using an ID
Before you start
Make sure you have your source ID at hand. You can find this in the source
object of your card payment request's response. It is prefixed by src_
.
The request
Use the details below to set up your request.
Endpoints
For the full API specification, see the API reference.
https://api.checkout.com/payments
IPv4 or IPv6 addresses?
The optional payment_ip
field, which is used by our risk engine to check the customer's IP address, only accepts IPv4 addresses.
Request example
{"source": {"type": "id","id": "src_nwd3m4in3hkuddfpjsaevunhdy"},"amount": 6500,"currency": "USD","reference": "ORD-5023-4E89","metadata": {"udf1": "TEST123","coupon_code": "NY2018","partner_id": 123989}}
The response
Use the approved
field to check whether or not the authorization was successful ("approved": true
). If your authorization was not successful, it's possible the payment used an invalid/expired card, or a valid card with an insufficient available balance.
If you received a 202
response, the payment requires a redirect. For example, if the payment is 3D Secure.
The following pages can help you understand the response message:
- CVV codes and descriptions
- AVS codes
- Response codes (if the authorization was unsuccessful)
Response example
The possible values for the status
field include Authorized
, Pending
, Card Verified
, Captured
, Declined
, or Paid
. Note that Pending
only applies to 3D Secure payments.
{"id": "src_nwd3m4in3hkuddfpjsaevunhdy","action_id": "act_mbabizu24mvu3mela5njyhpit4","amount": 6540,"currency": "USD","approved": true,"status": "Authorized","auth_code": "770687","response_code": "10000","response_summary": "Approved","3ds": {"downgraded": true,"enrolled": "N"},"risk": {"flagged": true},"source": {"type": "card","id": "src_nwd3m4in3hkuddfpjsaevunhdy","billing_address": {"address_line1": "Checkout.com","address_line2": "90 Tottenham Court Road","city": "London","state": "London","zip": "W1T 4TJ","country": "GB"},"phone": {"country_code": "+1","number": "415 555 2671"},"last4": "4242","fingerprint": "F31828E2BDABAE63EB694903825CDD36041CC6ED461440B81415895855502832","bin": "424242"},"customer": {"id": "cus_udst2tfldj6upmye2reztkmm4i","email": "brucewayne@gmail.com","name": "Bruce Wayne"},"processed_on": "2019-09-10T10:11:12Z","reference": "ORD-5023-4E89","processing": {"retrieval_reference_number": "909913440644","acquirer_transaction_id": "440644309099499894406"},"eci": "06","scheme_id": "489341065491658","links": {"self": {"href": "https://api.sandbox.checkout.com/payments/pay_mbabizu24mvu3mela5njyhpit4"},"action": {"href": "https://api.sandbox.checkout.com/payments/pay_mbabizu24mvu3mela5njyhpit4/actions"},"void": {"href": "https://api.sandbox.checkout.com/payments/pay_mbabizu24mvu3mela5njyhpit4/captures"},"capture": {"href": "https://api.sandbox.checkout.com/payments/pay_mbabizu24mvu3mela5njyhpit4/voids"}}}