Skip to main content

Documentation

Retrieve Payment

Retrieve details of a payment.

Note

    • payment

    • ID of the payment. String starting with payment_.

Code Samples
    • .NET

      • using System;
        
        namespace RapydApiRequestSample
        {
            class Program
            {
                static void Main(string[] args)
                {
                    try
                    {
                        string payment = "payment_19e3edad1e9102cd24006a34c52c9a0b";
        
                        string result = RapydApiRequestSample.Utilities.MakeRequest("GET", $"/v1/payments/{payment}");
        
                        Console.WriteLine(result);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Error completing request: " + e.Message);
                    }
                }
            }
        }
        
    • JavaScript

      • const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest;
        
        async function main() {
          try {
            const result = await makeRequest(
              'GET',
              '/v1/payments/payment_19e3edad1e9102cd24006a34c52c9a0b'
            );
        
            console.log(result);
          } catch (error) {
            console.error('Error completing request', error);
          }
        }
    • PHP

      • <?php
        $path = $_SERVER['DOCUMENT_ROOT'];
        $path .= "/<path-to-your-utility-file>/utilities.php";
        include($path);
        
        try {
            $object = make_request('get', '/v1/payments/payment_19e3edad1e9102cd24006a34c52c9a0b');
            var_dump($object);
        } catch(Exception $e) {
            echo "Error: $e";
        }
        ?>
    • Python

      • from pprint import pprint
        
        from utilities import make_request
        
        payment = "payment_19e3edad1e9102cd24006a34c52c9a0b"
        response = make_request(method='get',
                                path=f'/v1/payments/{payment}')
        
        pprint(response)
        
  • /v1/payments/:payment

  • Retrieve Payment

  • curl -X get 'https://sandboxapi.rapyd.net/v1/payments/payment_f2e57196a80852a24b644ef6ceea56f7' \
    -H 'access_key: your-access-key-here' \
    -H 'Content-Type: application/json' \
    -H 'salt: your-random-string-here' \
    -H 'signature: your-calculated-signature-here' \
    -H 'timestamp: your-unix-timestamp-here'
  • {
        "status": {
            "error_code": "",
            "status": "SUCCESS",
            "message": "",
            "response_code": "",
            "operation_id": "df485eea-56a7-4878-b7a1-43fd590036b2"
        },
        "data": {
            "id": "payment_f2e57196a80852a24b644ef6ceea56f7",
            "amount": 0,
            "original_amount": 1000,
            "is_partial": false,
            "currency_code": "PLN",
            "country_code": "pl",
            "status": "EXP",
            "description": "Bank transfer payment using prerequisite PM",
            "merchant_reference_id": "",
            "customer_token": "cus_f3d4d8575d30b27aa39230e76fb83a54",
            "payment_method": "other_2d1a55ed70548f259f6a488fd81ed96a",
            "payment_method_data": {
                "id": "other_2d1a55ed70548f259f6a488fd81ed96a",
                "type": "pl_p24_bank",
                "category": "bank_redirect",
                "metadata": {
                    "merchant_defined": true
                },
                "image": "",
                "webhook_url": "",
                "supporting_documentation": "",
                "next_action": "not_applicable",
                "bic_swift": "",
                "account_last4": ""
            },
            "auth_code": null,
            "expiration": 1755097289,
            "captured": true,
            "refunded": false,
            "refunded_amount": 0,
            "receipt_email": "",
            "redirect_url": "https://sandboxcheckout.rapyd.net/complete-bank-payment?token=payment_f2e57196a80852a24b644ef6ceea56f7&complete_payment_url=&error_payment_url=",
            "complete_payment_url": "",
            "error_payment_url": "",
            "receipt_number": "",
            "flow_type": "",
            "address": null,
            "statement_descriptor": "Doc Team",
            "transaction_id": "",
            "created_at": 1753887689,
            "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_c1943cfeda5f98247ab117e5d2648861",
            "ewallets": [
                {
                    "ewallet_id": "ewallet_c1943cfeda5f98247ab117e5d2648861",
                    "amount": 1000,
                    "percent": 100,
                    "refunded_amount": 0
                }
            ],
            "payment_method_options": {},
            "payment_method_type": "pl_p24_bank",
            "payment_method_type_category": "bank_redirect",
            "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": "",
            "next_action": "not_applicable",
            "error_code": "",
            "remitter_information": {},
            "save_payment_method": false,
            "merchant_advice_code": null,
            "merchant_advice_message": null,
            "transaction_link_id": null
        }
    }
  • Bad Request - Payment Not Found

  • curl -X get 'https://sandboxapi.rapyd.net/v1/payments/payment_d38fed6ea3bc540cde12b4c3ce7c9abe' \
    -H 'access_key: your-access-key-here' \
    -H 'Content-Type: application/json' \
    -H 'salt: your-random-string-here' \
    -H 'signature: your-calculated-signature-here' \
    -H 'timestamp: your-unix-timestamp-here'
  • {
        "status": {
            "error_code": "ERROR_GET_PAYMENT",
            "status": "ERROR",
            "message": "The request tried to retrieve a payment, but the payment was not found. The request was rejected. Corrective action: Use a valid payment ID.",
            "response_code": "ERROR_GET_PAYMENT",
            "operation_id": "97cbc669-7f22-47f8-98d0-8819da57c585"
        }
    }
  • Bad Request - Payment Missing

  • curl -X get  'https://sandboxapi.rapyd.net/v1/payments/payment_' \
    -H 'access_key: your-access-key-here' \
    -H 'Content-Type: application/json' \
    -H 'salt: your-random-string-here' \
    -H 'signature: your-calculated-signature-here' \
    -H 'timestamp: your-unix-timestamp-here'
  • {
        "status": {
            "error_code": "ERROR_GET_PAYMENT",
            "status": "ERROR",
            "message": "The request tried to retrieve a payment, but the payment was not found. The request was rejected. Corrective action: Use a valid payment ID.",
            "response_code": "ERROR_GET_PAYMENT",
            "operation_id": "97cbc669-7f22-47f8-98d0-8819da57c585"
        }
    }
  • Unauthorized

  • curl -X get 'https://sandboxapi.rapyd.net/v1/payments/payment_d38fed6ea3bc540cde12b4c3ce7c9abe' \
    -H 'access_key: your-access-key-here' \
    -H 'Content-Type: application/json' \
    -H 'salt: your-random-string-here' \
    -H 'signature: your-calculated-signature-here' \
    -H 'timestamp: your-unix-timestamp-here'
  • {
        "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": "0d0be3fc-b62b-4b02-bf3e-ed643010718c"
        }
    }