Skip to main content

Documentation

Creating a Payment With Updatable Amount

Create a card payment and then later increase the amount. Use this procedure when the final amount is not known or the customer incurs additional charges after the card is swiped. For example:

  • Hotels - The guest might stay extra days or incur charges from the in-room mini-bar or at the restaurant.

  • Car Rentals - The renter might want the agency to fill up the car with gas when the car is returned.

Note

The incremental authorization feature is in beta testing. To enable this feature, contact Rapyd Client Support.

Relevant to payment method types that support this feature. Run List Payment Methods by Country and refer to the value of the payment_method_options.is_adjustable parameter.

How

This procedure includes the following steps:

Create Payment

This step creates a card payment for authorization only. Include all parameters that are required for the payment method type. For more information, run Get Payment Method Required Fields.

  1. Run Create Payment with the following parameters:

    • amount - The amount of the authorization.

    • capture - Set to false.

    • client_details - Include an object that describes details of the client's browser, as required for 3DS authentication. For more information, see Create Payment.

    • complete_payment_url - URL where the customer is redirected after successfully completing an operation on a hosted page.

    • currency - The three-letter ISO 4217 code for the currency.

    • error_payment_url - URL where the customer is redirected if an error occurs during or after an operation on a hosted page.

    • payment_method_options.is_adjustable - Set to true. This setting creates a pre-authorization, which is valid for 30 days.

      • Request

        • curl -X post 'https://sandboxapi.rapyd.net/v1/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 '{
              "amount": 100,
              "currency": "GBP",
              "description": "Limousine service",
              "enhanced_data": {},
              "payment_method": {
                  "type": "gb_visa_card",
                  "fields": {
                      "name": "John Doe",
                      "number": "4176660000000100",
                      "expiration_month": "01",
                      "expiration_year": "29",
                      "cvv": "123"
                  }
              },
              "payment_method_options": {
                  "is_adjustable": true
              },
              "capture": false,
              "save_payment_method": true,
              "complete_payment_url": "https://www.demo123456.com/complete",
              "error_payment_url": "https://www.demo123456.com/error"
          }'
      • Response

        • {
              "status": {
                  "error_code": "",
                  "status": "SUCCESS",
                  "message": "",
                  "response_code": "",
                  "operation_id": "fbb3f728-05cd-4ec1-9e5e-7ce6b2cdd2b4"
              },
              "data": {
                  "id": "payment_fb3f486eaf16c1d3e0c7c1b1bba85b22",
                  "amount": 0,
                  "original_amount": 100,
                  "is_partial": false,
                  "currency_code": "GBP",
                  "country_code": "GB",
                  "status": "ACT",
                  "description": "Limousine service",
                  "merchant_reference_id": "",
                  "customer_token": "cus_9cb668a06820dfad16560fcb7d66bf8b",
                  "payment_method": "card_2926398a8aa1df155399e837db4cc124",
                  "payment_method_data": {
                      "id": "card_2926398a8aa1df155399e837db4cc124",
                      "type": "gb_visa_card",
                      "category": "card",
                      "metadata": null,
                      "image": "",
                      "webhook_url": "",
                      "supporting_documentation": "",
                      "next_action": "not_applicable",
                      "name": "John Doe",
                      "last4": "0100",
                      "acs_check": "pass",
                      "cvv_check": "pass",
                      "bin_details": {
                          "type": "CREDIT",
                          "brand": "VISA",
                          "level": "CLASSIC",
                          "issuer": "VISA EUROPE LIMITED",
                          "country": "GB",
                          "bin_number": "417666"
                      },
                      "expiration_year": "29",
                      "expiration_month": "01",
                      "fingerprint_token": "ocfp_8eb736573e0985910cbd9303441ab75d",
                      "network_reference_id": "000000258200813",
                      "payment_account_reference": "V0010019169397631953494893013"
                  },
                  "auth_code": "645605",
                  "expiration": 1771632000,
                  "captured": false,
                  "refunded": false,
                  "refunded_amount": 0,
                  "receipt_email": "",
                  "redirect_url": "",
                  "complete_payment_url": "https://www.demo123456.com/complete",
                  "error_payment_url": "https://www.demo123456.com/error",
                  "receipt_number": "",
                  "flow_type": "",
                  "address": null,
                  "statement_descriptor": "Four Star Limousine",
                  "transaction_id": "",
                  "created_at": 1769060571,
                  "metadata": {},
                  "failure_code": "",
                  "failure_message": "",
                  "paid": false,
                  "paid_at": 0,
                  "dispute": null,
                  "refunds": null,
                  "order": null,
                  "outcome": null,
                  "visual_codes": {},
                  "textual_codes": {},
                  "instructions": [],
                  "ewallet_id": "ewallet_c3016bb4e958f489046b5a7e82826063",
                  "ewallets": [
                      {
                          "ewallet_id": "ewallet_c3016bb4e958f489046b5a7e82826063",
                          "amount": 100,
                          "percent": 100,
                          "refunded_amount": 0
                      }
                  ],
                  "payment_method_options": {
                      "3d_required": true,
                      "is_adjustable": true
                  },
                  "payment_method_type": "gb_visa_card",
                  "payment_method_type_category": "card",
                  "fx_rate": 1,
                  "merchant_requested_currency": null,
                  "merchant_requested_amount": null,
                  "fixed_side": "",
                  "payment_fees": null,
                  "invoice": "",
                  "escrow": null,
                  "group_payment": "",
                  "cancel_reason": null,
                  "initiation_type": "customer_present",
                  "mid": "mid_26302_00000001",
                  "next_action": "pending_capture",
                  "error_code": "",
                  "remitter_information": {},
                  "save_payment_method": true,
                  "merchant_advice_code": null,
                  "merchant_advice_message": null,
                  "authentication_result": {
                      "eci": "05",
                      "result": "A",
                      "version": "2.2.0",
                      "cardholder_info": null
                  },
                  "transaction_link_id": null
              }
          }
Update Payment

This step increases the amount.

Note

This step must be done before the expiration of the payment. You can repeat this step as often as required, as long as the payment has not expired.

  1. Run Update Payment with the following parameters:

    • payment - Set the path parameter to the ID of the payment, a string starting with payment_.

    • amount - The new amount of the payment. The amount must be larger than the previously authorized amount.

      • Request

        • curl -X post 'https://api.rapyd.net/v1/payments/payment_fb3f486eaf16c1d3e0c7c1b1bba85b22' \
          -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 '{
              "amount": 500,
              "description": "Increasing amount to 500"
          }'
      • Response

        • {
              "status": {
                  "error_code": "",
                  "status": "SUCCESS",
                  "message": "",
                  "response_code": "",
                  "operation_id": "a336f29f-4b4d-4e9b-8a82-ca6cff275688"
              },
              "data": {
                  "id": "payment_fb3f486eaf16c1d3e0c7c1b1bba85b22",
                  "amount": 0,
                  "original_amount": 500,
                  "is_partial": false,
                  "currency_code": "GBP",
                  "country_code": "GB",
                  "status": "ACT",
                  "description": "Increasing amount to 500",
                  "merchant_reference_id": "",
                  "customer_token": "cus_9cb668a06820dfad16560fcb7d66bf8b",
                  "payment_method": "card_2926398a8aa1df155399e837db4cc124",
                  "payment_method_data": {
                      "id": "card_2926398a8aa1df155399e837db4cc124",
                      "type": "gb_visa_card",
                      "category": "card",
                      "metadata": null,
                      "image": "",
                      "webhook_url": "",
                      "supporting_documentation": "",
                      "next_action": "not_applicable",
                      "name": "John Doe",
                      "last4": "0100",
                      "acs_check": "pass",
                      "cvv_check": "pass",
                      "bin_details": {
                          "type": "CREDIT",
                          "brand": "VISA",
                          "level": "CLASSIC",
                          "issuer": "VISA EUROPE LIMITED",
                          "country": "GB",
                          "bin_number": "417666"
                      },
                      "expiration_year": "29",
                      "expiration_month": "01",
                      "fingerprint_token": "ocfp_8eb736573e0985910cbd9303441ab75d",
                      "network_reference_id": "000000258200813",
                      "payment_account_reference": "V0010019169397631953494893013"
                  },
                  "auth_code": "404383",
                  "expiration": 1771632000,
                  "captured": false,
                  "refunded": false,
                  "refunded_amount": 0,
                  "receipt_email": "",
                  "redirect_url": "",
                  "complete_payment_url": "https://www.demo123456.com/complete",
                  "error_payment_url": "https://www.demo123456.com/error",
                  "receipt_number": "",
                  "flow_type": "",
                  "address": null,
                  "statement_descriptor": "Four Star Limousine",
                  "transaction_id": "",
                  "created_at": 1769060571,
                  "metadata": {},
                  "failure_code": "",
                  "failure_message": "",
                  "paid": false,
                  "paid_at": 0,
                  "dispute": null,
                  "refunds": null,
                  "order": null,
                  "outcome": null,
                  "visual_codes": {},
                  "textual_codes": {},
                  "instructions": [],
                  "ewallet_id": "ewallet_c3016bb4e958f489046b5a7e82826063",
                  "ewallets": [
                      {
                          "ewallet_id": "ewallet_c3016bb4e958f489046b5a7e82826063",
                          "amount": 100,
                          "percent": 100,
                          "refunded_amount": 0
                      }
                  ],
                  "payment_method_options": {
                      "3d_required": true,
                      "is_adjustable": true
                  },
                  "payment_method_type": "gb_visa_card",
                  "payment_method_type_category": "card",
                  "fx_rate": 1,
                  "merchant_requested_currency": null,
                  "merchant_requested_amount": null,
                  "fixed_side": "",
                  "payment_fees": null,
                  "invoice": "",
                  "escrow": null,
                  "group_payment": "",
                  "cancel_reason": null,
                  "initiation_type": "customer_present",
                  "mid": "mid_26302_00000001",
                  "next_action": "pending_capture",
                  "error_code": "",
                  "remitter_information": {},
                  "save_payment_method": true,
                  "merchant_advice_code": null,
                  "merchant_advice_message": null,
                  "authentication_result": {
                      "eci": "05",
                      "result": "A",
                      "version": "2.2.0",
                      "cardholder_info": null
                  },
                  "transaction_link_id": null
              }
          }
Capture Payment

This step transfers the funds to the merchant's client wallet.

  1. Run Capture Payment with the following parameters:

    • payment - Set the ID of the payment, a string starting with payment_.

    • amount - Set the amount you want to capture.

      • Request

        • curl -X post 'https://api.rapyd.net/v1/payments/payment_fb3f486eaf16c1d3e0c7c1b1bba85b22' \
          -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 '{
              "amount": 435
          }'
      • Response

        • {
              "status": {
                  "error_code": "",
                  "status": "SUCCESS",
                  "message": "",
                  "response_code": "",
                  "operation_id": "c26baa5e-1764-4f47-9d98-9d60f4da485d"
              },
              "data": {
                  "id": "payment_fb3f486eaf16c1d3e0c7c1b1bba85b22",
                  "amount": 435,
                  "original_amount": 435,
                  "is_partial": false,
                  "currency_code": "GBP",
                  "country_code": "GB",
                  "status": "CLO",
                  "description": "Limousine service",
                  "merchant_reference_id": "",
                  "customer_token": "cus_9cb668a06820dfad16560fcb7d66bf8b",
                  "payment_method": "card_2926398a8aa1df155399e837db4cc124",
                  "payment_method_data": {
                      "id": "card_2926398a8aa1df155399e837db4cc124",
                      "type": "gb_visa_card",
                      "category": "card",
                      "metadata": null,
                      "image": "",
                      "webhook_url": "",
                      "supporting_documentation": "",
                      "next_action": "not_applicable",
                      "name": "John Doe",
                      "last4": "0100",
                      "acs_check": "pass",
                      "cvv_check": "pass",
                      "bin_details": {
                          "type": "CREDIT",
                          "brand": "VISA",
                          "level": "CLASSIC",
                          "issuer": "VISA EUROPE LIMITED",
                          "country": "GB",
                          "bin_number": "417666"
                      },
                      "expiration_year": "29",
                      "expiration_month": "01",
                      "fingerprint_token": "ocfp_8eb736573e0985910cbd9303441ab75d",
                      "network_reference_id": "000000258200813",
                      "payment_account_reference": "V0010019169397631953494893013"
                  },
                  "auth_code": "404383",
                  "expiration": 1771632000,
                  "captured": true,
                  "refunded": false,
                  "refunded_amount": 0,
                  "receipt_email": "",
                  "redirect_url": "",
                  "complete_payment_url": "https://www.demo123456.com/complete",
                  "error_payment_url": "https://www.demo123456.com/error",
                  "receipt_number": "",
                  "flow_type": "",
                  "address": null,
                  "statement_descriptor": "Four Star Limousine",
                  "transaction_id": "",
                  "created_at": 1769060571,
                  "metadata": {},
                  "failure_code": "",
                  "failure_message": "",
                  "paid": true,
                  "paid_at": 1769060627,
                  "dispute": null,
                  "refunds": null,
                  "order": null,
                  "outcome": null,
                  "visual_codes": {},
                  "textual_codes": {},
                  "instructions": [],
                  "ewallet_id": "ewallet_c3016bb4e958f489046b5a7e82826063",
                  "ewallets": [
                      {
                          "ewallet_id": "ewallet_c3016bb4e958f489046b5a7e82826063",
                          "amount": 100,
                          "percent": 100,
                          "refunded_amount": 0
                      }
                  ],
                  "payment_method_options": {
                      "3d_required": true,
                      "is_adjustable": true
                  },
                  "payment_method_type": "gb_visa_card",
                  "payment_method_type_category": "card",
                  "fx_rate": 1,
                  "merchant_requested_currency": null,
                  "merchant_requested_amount": null,
                  "fixed_side": "",
                  "payment_fees": null,
                  "invoice": "",
                  "escrow": null,
                  "group_payment": "",
                  "cancel_reason": null,
                  "initiation_type": "customer_present",
                  "mid": "mid_26302_00000001",
                  "next_action": "not_applicable",
                  "error_code": "",
                  "remitter_information": {},
                  "save_payment_method": true,
                  "merchant_advice_code": null,
                  "merchant_advice_message": null,
                  "authentication_result": {
                      "eci": "05",
                      "result": "A",
                      "version": "2.2.0",
                      "cardholder_info": null
                  },
                  "transaction_link_id": null
              }
          }