Skip to main content

Documentation

Retrieve Product

Retrieve details of a product or service.

    • product

    • ID of the product.

Code Samples
    • .NET

      • using System;
        
        namespace RapydApiRequestSample
        {
            class Program
            {
                static void Main(string[] args)
                {
                    try
                    {
                        string product = "product_0d9dc6be69c769560fe913f3b086d8ca";
        
                        string result = RapydApiRequestSample.Utilities.MakeRequest("GET", $"/v1/products/{product}");
        
                        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/products/product_0d9dc6be69c769560fe913f3b086d8ca'
            );
        
            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/products/product_0d9dc6be69c769560fe913f3b086d8ca');
            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/products/product_0d9dc6be69c769560fe913f3b086d8ca')
        pprint(result)
        
  • /v1/products/:product

  • Retrieve Product

  • curl -X get
    https://sandboxapi.rapyd.net/v1/products/product_0d9dc6be69c769560fe913f3b086d8ca
    -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": "2e96bb24-5a8e-453a-afee-3c5cb1c188ea"
        },
        "data": {
            "id": "product_0d9dc6be69c769560fe913f3b086d8ca",
            "active": true,
            "attributes": [
                "armrest",
                "color",
                "cover"
            ],
            "created_at": 1592299157,
            "description": "The ultimate in comfort for the dedicated gamer.",
            "metadata": {
                "merchant_defined": true
            },
            "name": "Gamer's Red Chair",
            "package_dimensions": {
                "height": 10,
                "length": 20,
                "weight": 100,
                "width": 40
            },
            "shippable": true,
            "skus": [],
            "statement_descriptor": "",
            "type": "goods",
            "unit_label": "",
            "updated_at": 1592300812
        }
    }