Skip to main content

Documentación

Create Payment Link

Creates a reusable link for a hosted payment page.

A customer can use the link and the hosted payment page multiple times. After providing required information, the customer is redirected seamlessly to a Rapyd Checkout page to complete the payment.

You can create the link for everyone or for a specific customer. You can make the payment amount fixed, editable, or open.

Nota

  • /v1/hosted/collect/payments

  • Fixed amount with maximum payments defined

  • curl -X post 'https://sandboxapi.rapyd.net/v1/hosted/collect/payments' \
    -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' \
    --data-raw '{
        "country": "GB",
        "currency": "GBP",
        "amount": "100",
        "merchant_reference_id": "payment link",
        "language": "EN",
        "checkout": {
            "error_payment_url": "https://error.rapyd.com",
            "complete_payment_url": "https://complete.rapyd.com"
        },
        "max_payments": 3
    }'
  • {
        "status": {
            "error_code": "",
            "status": "SUCCESS",
            "message": "",
            "response_code": "",
            "operation_id": "66afd8dd-53a0-456f-a201-cc8e6694fe1e"
        },
        "data": {
            "id": "hp_reuse_9ac0e8912b058a4d9169590ec64c2cd4",
            "amount": 100,
            "currency": "GBP",
            "country": "GB",
            "amount_is_editable": false,
            "merchant_reference_id": "payment link",
            "template": {
                "error_payment_url": "https://error.rapyd.com",
                "complete_payment_url": "https://complete.rapyd.com"
            },
            "customer": "",
            "requested_currency": null,
            "fixed_side": null,
            "max_payments": 3,
            "status": "NEW",
            "language": "en",
            "org_id": "153e08b8-4bf3-4cb9-bb03-79d405eaed2a",
            "merchant_color": "323fff",
            "merchant_logo": "",
            "merchant_website": "https://example1234.net",
            "merchant_customer_support": {
                "url": "https://example1234.net",
                "email": "support@example1234.net",
                "phone_number": "121255551213"
            },
            "merchant_alias": "Doc Team",
            "merchant_terms": "https://example1234.net/terms_and_conditions",
            "merchant_privacy_policy": "https://example1234.net/privacy_policy",
            "page_expiration": 1795434475,
            "redirect_url": "https://sbox.rapyd.ly/pay/rlna3Xdb"
        }
    }
  • Editable amount

  • curl -X post 'https://sandboxapi.rapyd.net/v1/hosted/collect/payments' \
    -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' \
    --data-raw '{
        "country": "GB",
        "currency": "GBP",
        "amount": "100",
        "amount_is_editable": true,
        "merchant_reference_id": "payment link",
        "language": "EN",
        "checkout": {
            "error_payment_url": "https://www.rapyd.net",
            "complete_payment_url": "https://www.rapyd.net/developers/"
        }
    }'
  • {
        "status": {
            "error_code": "",
            "status": "SUCCESS",
            "message": "",
            "response_code": "",
            "operation_id": "0c2e4a5b-1f95-4a7b-af56-12cde67a3c75"
        },
        "data": {
            "id": "hp_reuse_a964d7c0592ca1b6fb54f211fff204c0",
            "amount": 100,
            "currency": "GBP",
            "country": "GB",
            "amount_is_editable": true,
            "merchant_reference_id": "payment link",
            "template": {
                "error_payment_url": "https://www.rapyd.net",
                "complete_payment_url": "https://www.rapyd.net/developers/"
            },
            "customer": "",
            "requested_currency": null,
            "fixed_side": null,
            "max_payments": null,
            "status": "NEW",
            "language": "en",
            "org_id": "153e08b8-4bf3-4cb9-bb03-79d405eaed2a",
            "merchant_color": "323fff",
            "merchant_logo": "",
            "merchant_website": "https://example1234.net",
            "merchant_customer_support": {
                "url": "https://example1234.net",
                "email": "support@example1234.net",
                "phone_number": "121255551213"
            },
            "merchant_alias": "Doc Team",
            "merchant_terms": "https://example1234.net/terms_and_conditions",
            "merchant_privacy_policy": "https://example1234.net/privacy_policy",
            "page_expiration": 1795434677,
            "redirect_url": "https://sbox.rapyd.ly/pay/CUDkdBcV"
        }
    }
  • Open amount

  • curl -X post 'https://sandboxapi.rapyd.net/v1/hosted/collect/payments' \
    -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' \
    --data-raw '{
        "country": "GB",
        "currency": "GBP",
        "amount_is_editable": true,
        "merchant_reference_id": "payment link",
        "language": "EN",
        "checkout": {
            "error_payment_url": "https://www.rapyd.net",
            "complete_payment_url": "https://www.rapyd.net/developers/"
        }
    }'
  • {
        "status": {
            "error_code": "",
            "status": "SUCCESS",
            "message": "",
            "response_code": "",
            "operation_id": "b98acc9a-3d0d-489e-9e10-7a5643a09d86"
        },
        "data": {
            "id": "hp_reuse_1ea5d28c63af892b9def5dff3177e342",
            "amount": null,
            "currency": "GBP",
            "country": "GB",
            "amount_is_editable": true,
            "merchant_reference_id": "payment link",
            "template": {
                "error_payment_url": "https://error.rapyd.net",
                "complete_payment_url": "https://complete.rapyd.net"
            },
            "customer": "",
            "requested_currency": null,
            "fixed_side": null,
            "max_payments": null,
            "status": "NEW",
            "language": "en",
            "org_id": "153e08b8-4bf3-4cb9-bb03-79d405eaed2a",
            "merchant_color": "323fff",
            "merchant_logo": "",
            "merchant_website": "https://example1234.net",
            "merchant_customer_support": {
                "url": "https://example1234.net",
                "email": "support@example1234.net",
                "phone_number": "121255551213"
            },
            "merchant_alias": "Doc Team",
            "merchant_terms": "https://example1234.net/terms_and_conditions",
            "merchant_privacy_policy": "https://example1234.net/privacy_policy",
            "page_expiration": 1795434738,
            "redirect_url": "https://sbox.rapyd.ly/pay/lScEj2mv"
        }
    }
  • Bad Request - Missing fields

  • curl -X post
    'https://sandboxapi.rapyd.net/v1/hosted/collect/payments'
    -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'
    --data-raw '
    {
        "currency": "GBP",
        "amount": "100",
        "amount_is_editable": true,
        "merchant_reference_id": "payment link",
        "language": "EN",
        "checkout": {
            "error_payment_url": "https://www.example678.com/error",
            "complete_payment_url": "https://www.example678.com/complete"
        }
    }
    '
  • {
        "status": {
            "error_code": "MISSING_FIELDS - [COUNTRY]",
            "status": "ERROR",
            "message": "The request attempted an operation, but one or more required fields were missing. The request was rejected. Corrective action: Provide all of the fields that are listed at the end of the response code.",
            "response_code": "MISSING_FIELDS - [COUNTRY]",
            "operation_id": "3946e5b0-9207-4ba3-990a-eeee7cf3d901"
        }
    }
  • Bad Request - Invalid field value

  • curl -X post
    'https://sandboxapi.rapyd.net/v1/hosted/collect/payments'
    -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'
    --data-raw '
    {
        "country": "US",
        "currency": "USD",
        "amount": "100$",
        "amount_is_editable": true,
        "merchant_reference_id": "payment link",
        "language": "EN",
        "checkout": {
            "error_payment_url": "https://www.example678.com/error",
            "complete_payment_url": "https://www.example678.com/complete"
        }
    }
    '
  • {
        "status": {
            "error_code": "INVALID_FIELDS - [AMOUNT]",
            "status": "ERROR",
            "message": "The request attempted an operation, but one or more of the fields did not have a valid value. The request was rejected. Corrective action: Use valid values. The names of the affected fields appear at the end of the error code. See the API Reference for details.",
            "response_code": "INVALID_FIELDS - [AMOUNT]",
            "operation_id": "3ee5715d-0071-4166-8cab-04c9fb727a26"
        }
    }
  • Unauthorized

  • curl -X post
    https://sandboxapi.rapyd.net/v1/hosted/collect/payments
    -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'
    --data-raw '{
        "country": "GB",
        "currency": "GBP",
        "amount_is_editable": true,
        "merchant_reference_id": "payment link",
        "language": "EN",
        "checkout": {
            "error_payment_url": "https://www.rapyd.com",
            "complete_payment_url": "https://www.rapyd.com"
        }
    }
    '
  • {
        "status": {
            "error_code": "UNAUTHENTICATED_API_CALL",
            "status": "ERROR",
            "message": "The request was rejected due to an authentication issue. Corrective action: Check the status of your account in the 'Account Details' page of the Client Portal.",
            "response_code": "UNAUTHENTICATED_API_CALL",
            "operation_id": "034ff9bc-e27c-405b-8f8d-437becbc2358"
        }
    }