Skip to main content

Documentation

Retrieve an Order

Retrieve the details of an order.

    • order

    • ID of the order to pay. String starting with order_.

Code Samples
    • .NET

      • using System;
        
        namespace RapydApiRequestSample
        {
            class Program
            {
                static void Main(string[] args)
                {
                    try
                    {
                        string order = "order_20bdf9df5841e57ba80e0a68085871ea";
        
                        string result = RapydApiRequestSample.Utilities.MakeRequest("GET", $"/v1/orders/{order}");
        
                        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/orders/order_20bdf9df5841e57ba80e0a68085871ea');
        
            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/orders/order_20bdf9df5841e57ba80e0a68085871ea');
            var_dump($object);
        } catch(Exception $e) {
            echo "Error: $e";
        }
        ?>
    • Python

      • from pprint import pprint
        
        from utilities import make_request
        
        result = make_request(method='get', path='/v1/orders/order_20bdf9df5841e57ba80e0a68085871ea')
        pprint(result)
  • /v1/orders/:order

  • Retrieve an Order

  • curl -X get
    https://sandboxapi.rapyd.net/v1/orders/order_b3395396fda6015c46bdbd5129cc9b21
    -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": "dd49d8b8-55b0-4103-adb6-015300241a14"
        },
        "data": {
            "id": "order_b3395396fda6015c46bdbd5129cc9b21",
            "amount": 121,
            "amount_returned": 0,
            "payment": {
                "id": "payment_5a8388924be5c8615987c947b9453836",
                "amount": 0,
                "original_amount": 121,
                "is_partial": false,
                "currency_code": "USD",
                "country_code": "us",
                "status": "ACT",
                "description": "",
                "merchant_reference_id": "",
                "customer_token": "cus_65435174ed4cc261e2f80f8cf0655804",
                "payment_method": "other_aaf26f779345ac72a6af73fe47d67c74",
                "expiration": 0,
                "captured": true,
                "refunded": false,
                "refunded_amount": 0,
                "receipt_email": "example123@rapyd.net",
                "redirect_url": "https://sandboxdashboard.rapyd.net/complete-bank-payment?token=payment_5a8388924be5c8615987c947b9453836&complete_payment_url=&error_payment_url=",
                "complete_payment_url": "",
                "error_payment_url": "",
                "receipt_number": "",
                "flow_type": "",
                "address": null,
                "statement_descriptor": "Rapyd",
                "transaction_id": "",
                "created_at": 1603982601,
                "metadata": {},
                "failure_code": "",
                "failure_message": "",
                "paid": false,
                "paid_at": 0,
                "dispute": null,
                "refunds": null,
                "order": null,
                "outcome": null,
                "visual_codes": {},
                "textual_codes": {},
                "instructions": [
                    {
                        "name": "instructions",
                        "steps": [
                            {
                                "step1": "Enter 16-digit paysafecard number in your app."
                            }
                        ]
                    }
                ],
                "ewallet_id": "ewallet_c4bb3c5ae31339a86490096b73075860",
                "ewallets": [
                    {
                        "ewallet_id": "ewallet_c4bb3c5ae31339a86490096b73075860",
                        "amount": 121,
                        "percent": 100,
                        "refunded_amount": 0
                    }
                ],
                "payment_method_options": {},
                "payment_method_type": "us_psc_cash",
                "payment_method_type_category": "cash",
                "fx_rate": "",
                "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"
            },
            "created": 1603982486,
            "customer": "cus_65435174ed4cc261e2f80f8cf0655804",
            "currency": "USD",
            "email": "cdorsett@rapyd.net",
            "external_coupon_code": "",
            "items": [
                {
                    "amount": 11,
                    "currency": "USD",
                    "description": "10% tax on total order",
                    "parent": "",
                    "quantity": 0,
                    "type": "tax"
                },
                {
                    "amount": 10,
                    "currency": "USD",
                    "description": "Random item",
                    "parent": "sku_bfbf1f267ceffe50517a1eeee5b0f599",
                    "quantity": 10,
                    "type": "sku"
                },
                {
                    "amount": 10,
                    "currency": "USD",
                    "description": "Random item",
                    "parent": "",
                    "quantity": 1,
                    "type": "shipping"
                }
            ],
            "metadata": {},
            "returns": [],
            "shipping_address": {
                "id": "address_4cde9906bb8b54b02a248d2f18f5db60",
                "name": "",
                "line_1": "",
                "line_2": "",
                "line_3": "",
                "city": "",
                "state": "",
                "country": "",
                "zip": "",
                "phone_number": "",
                "metadata": {},
                "canton": "",
                "district": "",
                "created_at": 1603982486
            },
            "status": "fulfilled",
            "status_transitions": {
                "canceled": 0,
                "fulfilled": 1603982682,
                "paid": 0,
                "returned": 0,
                "pending": 1603982601,
                "partial": 0
            },
            "updated": 1603982682,
            "upstream_id": "ty-23",
            "tax_percent": 10
        }
    }