Receipts
Generated HTTP reference for the 2 operations the published OpenAPI document describes under receipts.
1 min read
Receipts
This page is generated from the published OpenAPI document. It is complete with respect to that document and says nothing about surfaces the document does not describe yet. See what is generated here for what that means.
Base URL: https://api.codespar.dev
Every operation below requires a Bearer token. See Authentication.
GET /v1/consumers/receipts/{id}
GET
https://api.codespar.dev/v1/consumers/receipts/{id}Read one agentic receipt
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The receipt id. |
Responses
| Status | Body | Description |
|---|---|---|
200 | object | OK |
404 | object | No receipt with this id in this project. A receipt in another project of the same organization answers the same way. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
chain | string | yes | — |
delivery | object,null | yes | Null until a delivery proof has been sealed onto the receipt. |
exceptions | array of object | yes | — |
mandate | object | yes | — |
payment | object | yes | — |
quote | object,null | yes | Null when the receipt carries neither a seller nor a resource. |
receipt_id | string | yes | — |
receipt_sig | string | yes | — |
state | "paid" | "delivered" | "exception" | "voided" | yes | — |
Example request
curl -X GET https://api.codespar.dev/v1/consumers/receipts/{id} \
-H "Authorization: Bearer $CODESPAR_API_KEY"const res = await fetch("https://api.codespar.dev/v1/consumers/receipts/{id}", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.CODESPAR_API_KEY}`,
},
});
const data = await res.json();Example response 200
{
"receipt_id": "receipt_0000000000000000",
"state": "paid",
"mandate": {
"id": "obj_0000000000000000",
"nonce": "string",
"scope": "string",
"currency": "BRL",
"sig": "string"
},
"quote": {},
"payment": {
"rail": "string",
"amount_minor": 1000,
"amount_authorized": "1000",
"amount_charged": "1000",
"amount_refunded": "1000",
"metering": {
"basis": "string",
"units": "string",
"unit_price": "string"
},
"sandbox": true,
"attempt_id": "attempt_0000000000000000",
"money_moved": true,
"at": "string"
},
"delivery": {
"result": "confirmed"
},
"chain": "string",
"receipt_sig": "string",
"exceptions": [
{
"code": "string",
"detail": "string",
"at": "string"
}
]
}GET /v1/consumers/{consumerId}/receipts
GET
https://api.codespar.dev/v1/consumers/{consumerId}/receiptsA consumer's agentic receipts
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
consumerId | string | yes | — |
Responses
| Status | Body | Description |
|---|---|---|
200 | object | OK |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
receipts | array of object | yes | — |
Example request
curl -X GET https://api.codespar.dev/v1/consumers/{consumerId}/receipts \
-H "Authorization: Bearer $CODESPAR_API_KEY"const res = await fetch("https://api.codespar.dev/v1/consumers/{consumerId}/receipts", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.CODESPAR_API_KEY}`,
},
});
const data = await res.json();Example response 200
{
"receipts": [
{
"receipt_id": "receipt_0000000000000000",
"state": "paid",
"mandate": {
"id": "obj_0000000000000000",
"nonce": "string",
"scope": "string",
"currency": "BRL",
"sig": "string"
},
"quote": {},
"payment": {
"rail": "string",
"amount_minor": 1000,
"amount_authorized": "1000",
"amount_charged": "1000",
"amount_refunded": "1000",
"metering": {
"basis": "string",
"units": "string",
"unit_price": "string"
},
"sandbox": true,
"attempt_id": "attempt_0000000000000000",
"money_moved": true,
"at": "string"
},
"delivery": {
"result": "confirmed"
},
"chain": "string",
"receipt_sig": "string",
"exceptions": [
{
"code": "string",
"detail": "string",
"at": "string"
}
]
}
]
}