POST
/
api
/
v1
/
server-to-server-interface
/
payment
cURL
curl --request POST \
  --url https://api-dev.paymentoptions.com/api/v1/api/v1/server-to-server-interface/payment \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "amount": "1000",
  "currency": "JPY",
  "payment_method": {
    "type": "scheme",
    "store_payment_method": true,
    "stored_payment_method_id": "094db781-fabc-4c6d-8fcd-18bee06a527a"
  },
  "merchant_txn_ref": "qwe",
  "customer_ip": "127.0.0.1",
  "merchant_id": "< Merchant ID >",
  "return_url": {
    "webhook_url": "< Webhook url >",
    "success_url": "http://www.successurl.com/",
    "decline_url": "http://www.declineurl.com/"
  },
  "billing_address": {
    "country": "JP",
    "email": "billing@testemail.com",
    "phone_number": "8112345678",
    "address1": "1-2-3 Shinjuku",
    "city": "Shinjuku-ku",
    "state": "Tokyo",
    "postal_code": "1600022"
  },
  "shipping_address": {
    "country": "JP",
    "email": "shipping@testemail.com",
    "phone_number": "8112345678",
    "address1": "1-2-3 Shinjuku",
    "city": "Shinjuku-ku",
    "state": "Tokyo",
    "postal_code": "1600022"
  },
  "time_zone": "Asia/Kuala_Lumpur"
}'
{
  "success": true,
  "status_code": 201,
  "is_live": false,
  "transaction_type": "CAPTURE",
  "gateway_response": {
    "version": "1",
    "type": "INFO",
    "message": "Payment Successful.",
    "code": "INFO0000"
  },
  "merchant_details": {
    "legal_name": "アイベック株式会社",
    "mid": "< Merchant ID >",
    "merchant_txn_ref": "qwe",
    "billing_details": {
      "billing_address": {
        "country": "JP",
        "email": "billing@testemail.com",
        "phone_number": "8112345678",
        "address1": "1-2-3 Shinjuku",
        "city": "Shinjuku-ku",
        "state": "Tokyo",
        "postal_code": "1600022"
      }
    },
    "device_details": {
      "visited_ip": "127.0.0.1",
      "merchant_ip": "127.0.0.1",
      "customer_ip": "127.0.0.1"
    }
  },
  "payment_details": {
    "amount": 1000,
    "response_code": 0,
    "auth_code": "268004",
    "currency": "JPY",
    "payment_method": "ECMC-SSL",
    "scheme": "MASTERCARD",
    "card": {
      "name": "John Doe",
      "number": "4000000000001091",
      "exp_month": "12",
      "exp_year": "24"
    },
    "additional_data": {
      "payment_data_source": {
        "type": "card"
      }
    }
  },
  "transaction_details": {
    "id": "0db1fac1-e064-4644-a387-08d143960c8f",
    "ref": 74811,
    "timestamp": "2024-11-25T08:24:36.000Z",
    "merchant_txn_ref": "qwe",
    "stored_payment_method_id": "094db781-fabc-4c6d-8fcd-18bee06a527a"
  },
  "risk-details": {
    "risk_score": null
  }
}

Key Points

  • Once a card token is generated, it can be used to execute Purchase or Authorization transactions.
  • The card token replaces the need for actual card details, ensuring that sensitive data is never exposed during the transaction.
  • This method is commonly used for: One-click payments, Recurring transactions (e.g., subscriptions), Stored customer payment details.

Flow diagram

Flow diagram image

Api Parameters

Card Token

Use the stored_payment_method_id (generated during token creation) in the payload to complete the transaction.
Request Example
  "payment_method":{
        "type":"scheme",
        "store_payment_method":true,
        "stored_payment_method_id": "094db781-fabc-4c6d-8fcd-18bee06a527a"
    },  
The stored_payment_method_id is the token generated from the card tokenization process and is used to securely complete subsequent transactions.

Authorizations

Authorization
string
header
required

API Key for Authorization. Format: 'Basic YOUR_API_KEY_HERE'

x-api-key
string
header
required

API Key specific to x-api-key.

Body

application/json

The request payload to process a payment transaction.

The body is of type object.

Response

201 - application/json

Payment processed successfully

The response is of type object.