For the complete documentation index, see llms.txt. This page is also available as Markdown.

COD (cash on delivery)

List of collected cash on delivery (COD) amounts

Cod

This endpoint lets you get the list of collected cash on delivery (COD) amounts.

GET https://api.gsped.it/[INSTANCE]/Cod

Query parameters

Name
Type
Description

client_id*

int

ID of the client (or of the invoiced client)

days

int

Retrieves COD amounts paid in the last X days (minimum 1, maximum 90, default 10)

Headers

Name
Type
Description

x-api-key*

string

API key provided by Gsped

{
    "status": 200,
    "response": [
        {...},
        {...},
    ]
}
{
  "status": 400,
  "errors": [
    "client_id obbligatorio"
  ],
  "response": []
}
{
  "status": false,
  "error": "Invalid API key "
}

Example code snippets

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.gsped.it/sandbox/Cod?client_id=123",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_POSTFIELDS => "",
  CURLOPT_HTTPHEADER => [
    "x-api-key: YOUR-API-KEY"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}