Skip to content

Step 1: Payment Methods

Retrieve available methods and saved payment options for your customer.

Endpoint

http
GET https://api.iimmpact.com/v2/payment-methods

Request headers

FieldTypeRequiredDescription
X-Api-KeystringYesYour API key; keep it on your backend.
X-TimestampstringYesCurrent Unix time in seconds; within five minutes of server time.
X-NoncestringYesFresh identifier for every request, including retries.
X-SignaturestringYesv1= followed by the request's HMAC signature.

Follow API Key Authentication. Sign an empty body and the sorted query.

Query fields

FieldTypeRequiredDescription
customer_external_idstringYesYour own customer ID as a non-empty string. No UUID, numeric, or email format is required. Use the same value when creating a payment.

URL-encode the ID, including any +, &, or / characters. IDs are matched exactly within your account; an unknown ID returns no saved methods. Your backend must authorize the customer making the lookup.

Request example

bash
curl 'https://api.iimmpact.com/v2/payment-methods?customer_external_id=CUS-1042' \
  --header "X-Api-Key: $API_KEY" \
  --header "X-Timestamp: $TIMESTAMP" \
  --header "X-Nonce: $NONCE" \
  --header "X-Signature: v1=$SIGNATURE"

Response fields

FieldTypeDescription
data.payment_methodsarrayAvailable methods. An empty array means payment is unavailable.
codestringMethod code for calculation and payment creation.
display_namestringCheckout label.
icon_urlstring or nullAlways returned; null when no icon is available.
descriptionstring or nullAlways returned; null when no display text is available.
feeobjectFixed or percentage payment fee.
saved_payment_methodsarrayThis customer's saved options for this method. Empty when none exist.

Saved payment method fields

FieldTypeDescription
saved_payment_method_idstringOpaque ID used to select this saved option at payment creation.
display_namestringReady-to-display label for the saved option.
cardobjectCard display details for a saved card; omitted for other method types.
card.brandstringCard brand, such as VISA, when card exists.
card.last4stringLast four digits for display, when card exists.
card.expiry_monthintegerExpiry month, 1–12, when card exists.
card.expiry_yearintegerFour-digit expiry year, when card exists.

Use the parent method's code and the saved option's ID to pay. Card details are display-only; selection does not depend on them.

Response example — 200

json
{
  "data": {
    "payment_methods": [
      {
        "code": "CARD",
        "display_name": "Card",
        "icon_url": null,
        "description": null,
        "fee": {
          "type": "percentage",
          "value": "1.70"
        },
        "saved_payment_methods": [
          {
            "saved_payment_method_id": "spm_example",
            "display_name": "Visa ending in 1091",
            "card": {
              "brand": "VISA",
              "last4": "1091",
              "expiry_month": 12,
              "expiry_year": 2029
            }
          }
        ]
      },
      {
        "code": "FPX",
        "display_name": "FPX Online Banking",
        "icon_url": null,
        "description": "Pay with your bank account",
        "fee": {
          "type": "fixed",
          "value": "2.00"
        },
        "saved_payment_methods": []
      }
    ]
  }
}

Errors

HTTPCodeAction
422validation_errorcustomer_external_id is missing or empty. Supply your customer ID; its format is not checked.

See shared errors for authentication and service failures.

Next: Calculate Order.

IIMMPACT API Documentation