Skip to main content

Documentation

Retrieve Payment Link

Retrieve details of a payment link.

    • payment_link

    • ID of the payment link. String starting with hp_reuse_.

Code Samples
    • .NET

      • using System;
        
        namespace RapydApiRequestSample
        {
            class Program
            {
                static void Main(string[] args)
                {
                    try
                    {
                        string id = "hp_reuse_44298a945030cbd9e8347383ac9c0c80";
        
                        string result = RapydApiRequestSample.Utilities.MakeRequest("GET", $"/v1/hosted/collect/payments/{id}");
        
                        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/hosted/collect/payments/hp_reuse_44298a945030cbd9e8347383ac9c0c80'
            );
        
            console.log(result);
          } catch (error) {
            console.error('Error completing request', error);
          }
        }onst makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest;
        
        async function main() {
          try {
            const body = {
              currency: 'USD',
              customer: 'cus_b3b8ad0174f4c415c663b35bcf542192',
              metadata: {
                merchant_defined: true
              },
              amount: 10
            };
            const result = await makeRequest('POST', '/v1/invoice_items', body);
        
            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/hosted/collect/payments/hp_reuse_44298a945030cbd9e8347383ac9c0c80');
            var_dump($object);
        } catch(Exception $e) {
            echo "Error: $e";
        }
        ?>
    • Python

      • from pprint import pprint
        
        from utilities import make_request
        
        id = "hp_reuse_44298a945030cbd9e8347383ac9c0c80"
        response = make_request(method='get',
                                path=f'/v1/hosted/collect/payments/{id}')
        
        pprint(response)?php
        $path = $_SERVER['DOCUMENT_ROOT'];
        $path .= "/<path-to-your-utility-file>/utilities.php";
        include($path);
        
        try {
            $object = make_request('get', '/v1/hosted/collect/payments/hp_reuse_44298a945030cbd9e8347383ac9c0c80');
            var_dump($object);
        } catch(Exception $e) {
            echo "Error: $e";
        }
        ?>rom pprint import pprint
        
        from utilities import make_request
        
        invoice_item = {
            "currency": "USD",
            "customer": "cus_b3b8ad0174f4c415c663b35bcf542192",
            "metadata": {
                "merchant_defined": True
            },
            "amount": 10
        }
        result = make_request(method='post', path='/v1/invoice_items', body=invoice_item)
        pprint(result)
  • /v1/hosted/collect/payments/:payment_link

  • Retrieve Payment Link

  • curl -X get
    https://sandboxapi.rapyd.net/v1/hosted/collect/payments/hp_reuse_bd5cbfc99af8fffc834c444e746246c3
    -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": "1b749c51-8700-4df0-91c2-8c75c8b8ac50"
        },
        "data": {
            "id": "hp_reuse_bd5cbfc99af8fffc834c444e746246c3",
            "amount": 100,
            "currency": "GBP",
            "country": "GB",
            "amount_is_editable": false,
            "merchant_reference_id": "payment link",
            "template": {
                "error_payment_url": "https://www.rapyd.com",
                "complete_payment_url": "https://www.rapyd.com"
            },
            "amount_range_per_currency_mapping": {
                "GBP": {
                    "min_amount": 0,
                    "max_amount": 1.7976931348623157e+308
                }
            },
            "customer": "",
            "requested_currency": null,
            "fixed_side": null,
            "max_payments": 3,
            "status": "NEW",
            "language": "en",
            "org_id": "b73f63ba-ee20-4070-a994-2c0d5f0c2f7c",
            "merchant_color": "",
            "merchant_logo": "",
            "merchant_website": "https://www.rapyd.net",
            "merchant_customer_support": {},
            "merchant_alias": "Doc Team",
            "merchant_terms": "",
            "merchant_privacy_policy": "",
            "page_expiration": 1716201337,
            "redirect_url": "https://qacheckout.rapyd.net/collect/payments?token=hp_reuse_bd5cbfc99af8fffc834c444e746246c3",
            "region": "AMERICAS",
            "geo_country": "US",
            "type": "CHECKOUT",
            "page_type": "REUSABLE_LINK"
        }
    }