Skip to main content

Documentation

Create Card Token

Create a hosted page for a customer to save card details and manage cards.

Prerequisites

Note

Rapyd sends you webhooks for the following customer actions:

  • /v1/hosted/collect/card

  • Create Card Token

  • curl -X post
    https://sandboxapi.rapyd.net/v1/hosted/collect/card
    -H 'access_key: your-access-key-here'
    -H 'Content-Type: application/json'
    -H 'idempotency: your-idempotency-parameter-here'
    -H 'salt: your-random-string-here'
    -H 'signature: your-calculated-signature-here'
    -H 'timestamp: your-unix-timestamp-here'
    -d '{
        "country": "US",
        "customer": "cus_9761efaa881b6edeab25e9fbfec1ddf5",
        "complete_payment_url": "https://complete.rapyd.net",
        "error_payment_url": "https://error.rapyd.net"
    }
    '
    
  • {
        "status": {
            "error_code": "",
            "status": "SUCCESS",
            "message": "",
            "response_code": "",
            "operation_id": "5155e447-899e-4439-ab13-257b055a4b2d"
        },
        "data": {
            "id": "hp_card_e8d50699a2f4ee6c47edad7d49101039",
            "status": "NEW",
            "cancel_url": "https://rapyd.net",
            "complete_url": "https://rapyd.net",
            "language": null,
            "merchant_color": "323fff",
            "merchant_logo": null,
            "merchant_website": "https://rapyd.net",
            "merchant_customer_support": {},
            "merchant_alias": "Doc Team",
            "page_expiration": 1669618261,
            "redirect_url": "https://sandboxhosted.rapyd.net/collect/card?token=hp_card_e8d50699a2f4ee6c47edad7d49101039",
            "category": "card",
            "country": "US",
            "currency": "USD",
            "customer": "cus_9761efaa881b6edeab25e9fbfec1ddf5",
            "payment_method_type": null,
            "payment_params": {
                "complete_payment_url": "https://complete.rapyd.net",
                "error_payment_url": "https://error.rapyd.net"
            },
            "billing_address_collect": false,
            "customer_card_payment_methods": null
        }
    }
Related Information