Skip to main content

Documentation

Retrieve Payment

Retrieve details of a payment.

    • 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_bebddc4b4139d5a0f13cdcd4046cf2c1
    -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": "0d651bc9-686c-4b5a-abad-3cdb4fae7042"
        },
        "data": {
            "id": "payment_bebddc4b4139d5a0f13cdcd4046cf2c1",
            "amount": 1000,
            "original_amount": 1000,
            "is_partial": false,
            "currency_code": "RUB",
            "country_code": "ru",
            "status": "CLO",
            "description": "",
            "merchant_reference_id": "",
            "customer_token": "cus_84806e121d2d8d08b30a5f99822243de",
            "payment_method": "other_75b307d4fc3713e5ca87f1434e9c30cc",
            "payment_method_data": {
                "id": "other_75b307d4fc3713e5ca87f1434e9c30cc",
                "type": "ru_qiwimobile_ewallet",
                "category": "ewallet",
                "metadata": {},
                "image": "",
                "authentication_url": "",
                "webhook_url": "",
                "supporting_documentation": ""
            },
            "expiration": 1623074321,
            "captured": true,
            "refunded": false,
            "refunded_amount": 0,
            "receipt_email": "",
            "redirect_url": "",
            "complete_payment_url": "",
            "error_payment_url": "",
            "receipt_number": "",
            "flow_type": "",
            "address": null,
            "statement_descriptor": "Rapyd",
            "transaction_id": "",
            "created_at": 1621864721,
            "metadata": {
                "merchant_defined": true
            },
            "failure_code": "",
            "failure_message": "",
            "paid": true,
            "paid_at": 1621948716,
            "dispute": null,
            "refunds": null,
            "order": null,
            "outcome": null,
            "visual_codes": {},
            "textual_codes": {
                "code": "paygw_65d788c95eefe636ab45fff9ae81c38d"
            },
            "instructions": [],
            "ewallet_id": "ewallet_c67c44ec60d5c2e62480aa7c76b3f8b4",
            "ewallets": [
                {
                    "ewallet_id": "ewallet_c67c44ec60d5c2e62480aa7c76b3f8b4",
                    "amount": 1000,
                    "percent": 100,
                    "refunded_amount": 0
                }
            ],
            "payment_method_options": {},
            "payment_method_type": "ru_qiwimobile_ewallet",
            "payment_method_type_category": "ewallet",
            "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"
        }
    }