Products
CRUD for your product catalog.
Newest first, as { data, total, take, skip } with take up to 100 (default 100). Inactive products (active: false) are included.
Requires the products:read scope.
apiKeyAuthorizationBearer <API key>Your Cosmos Pay secret API key, sent as Authorization: Bearer <apiKey>.
take?numberPage size: how many items to return (1 to 100).
value <= 100100skip?numberHow many items to skip before this page (offset).
0OK
The body, query or path failed validation. message is an array of the individual failures.
Routes that reject a valid request for a reason of their own (an amount, a memo, a state) document the code for it on their own 400.
no_authenticated_consumer: The gateway forwarded no API key identity
insufficient_scope: the API key does not hold the scope this route requires. The shared public API key also gets this on every route that is not marked x-cosmos-public-key, with a message saying so; more scopes will not help, the key is the wrong one.
gateway_required: the request did not arrive through APISIX.
Unexpected server error. The detail is logged server-side and never returned: there is nothing in the body to branch on beyond the code.
curl -X GET 'https://api.cosmospay.lat/cosmos-api/v1/products'{ "data": [ { "id": "clx9z8a1b0000abcd1234efgh", "name": "Pro plan (monthly)", "description": "Full access, billed every month.", "amount": "49.00", "asset": "native", "kind": "one_time", "active": true, "reference": "sku_pro_monthly", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" } ], "total": 137, "take": 100, "skip": 0}A catalog record: name, an optional decimal amount (up to 7 decimals; omit for a customer-set price), assetCode (omitted, XLM or native store native), kind (one_time by default, recurring or link, informational) and active (default true). Creating one builds no payment link or intent.
Requires the products:write scope.
apiKeyAuthorizationBearer <API key>Your Cosmos Pay secret API key, sent as Authorization: Bearer <apiKey>.
application/json- body
A catalog product to create. Creating one builds no payment link or intent.
name*stringProduct name (1 to 120 characters).
description?stringFree-text description of the product (at most 500 characters).
amount?stringDecimal price (≤ 7 decimals). Omit for a customer-set amount.
assetCode?stringAsset code the price is in. Omit for native lumens (XLM).
kind?stringInformational classification: one_time (default), recurring or link.
"one_time""recurring""one_time""link"active?booleanWhether the product is active. false retires it and keeps its record.
truereference?stringYour own SKU or reference for the product (at most 120 characters).
Created
The body, query or path failed validation. message is an array of the individual failures.
Routes that reject a valid request for a reason of their own (an amount, a memo, a state) document the code for it on their own 400.
no_authenticated_consumer: The gateway forwarded no API key identity
insufficient_scope: the API key does not hold the scope this route requires. The shared public API key also gets this on every route that is not marked x-cosmos-public-key, with a message saying so; more scopes will not help, the key is the wrong one.
gateway_required: the request did not arrive through APISIX.
Unexpected server error. The detail is logged server-side and never returned: there is nothing in the body to branch on beyond the code.
curl -X POST 'https://api.cosmospay.lat/cosmos-api/v1/products' \ -H 'Content-Type: application/json' \ -d '{ "name": "Pro plan (monthly)"}'{ "id": "clx9z8a1b0000abcd1234efgh", "name": "Pro plan (monthly)", "description": "Full access, billed every month.", "amount": "49.00", "asset": "native", "kind": "one_time", "active": true, "reference": "sku_pro_monthly", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}One of the consumer’s products, active or not.
Requires the products:read scope.
apiKeyAuthorizationBearer <API key>Your Cosmos Pay secret API key, sent as Authorization: Bearer <apiKey>.
id*stringOK
The body, query or path failed validation. message is an array of the individual failures.
Routes that reject a valid request for a reason of their own (an amount, a memo, a state) document the code for it on their own 400.
no_authenticated_consumer: The gateway forwarded no API key identity
insufficient_scope: the API key does not hold the scope this route requires. The shared public API key also gets this on every route that is not marked x-cosmos-public-key, with a message saying so; more scopes will not help, the key is the wrong one.
gateway_required: the request did not arrive through APISIX.
No such resource, or it exists and belongs to another consumer. The two are deliberately the same answer: "exists but not yours" is an ownership oracle.
Unexpected server error. The detail is logged server-side and never returned: there is nothing in the body to branch on beyond the code.
curl -X GET 'https://api.cosmospay.lat/cosmos-api/v1/products/string'{ "id": "clx9z8a1b0000abcd1234efgh", "name": "Pro plan (monthly)", "description": "Full access, billed every month.", "amount": "49.00", "asset": "native", "kind": "one_time", "active": true, "reference": "sku_pro_monthly", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}Changes only the fields sent; assetCode is normalized as on create. Set active: false to retire a product and keep its record.
Requires the products:write scope.
apiKeyAuthorizationBearer <API key>Your Cosmos Pay secret API key, sent as Authorization: Bearer <apiKey>.
id*stringapplication/json- body
Changes to a product: any subset of the create fields; only the fields sent change.
name?stringProduct name (1 to 120 characters).
description?stringFree-text description of the product (at most 500 characters).
amount?stringDecimal price (≤ 7 decimals). Omit for a customer-set amount.
assetCode?stringAsset code the price is in. Omit for native lumens (XLM).
kind?stringInformational classification: one_time (default), recurring or link.
"one_time""recurring""one_time""link"active?booleanWhether the product is active. false retires it and keeps its record.
truereference?stringYour own SKU or reference for the product (at most 120 characters).
OK
The body, query or path failed validation. message is an array of the individual failures.
Routes that reject a valid request for a reason of their own (an amount, a memo, a state) document the code for it on their own 400.
no_authenticated_consumer: The gateway forwarded no API key identity
insufficient_scope: the API key does not hold the scope this route requires. The shared public API key also gets this on every route that is not marked x-cosmos-public-key, with a message saying so; more scopes will not help, the key is the wrong one.
gateway_required: the request did not arrive through APISIX.
No such resource, or it exists and belongs to another consumer. The two are deliberately the same answer: "exists but not yours" is an ownership oracle.
Unexpected server error. The detail is logged server-side and never returned: there is nothing in the body to branch on beyond the code.
curl -X PATCH 'https://api.cosmospay.lat/cosmos-api/v1/products/string' \ -H 'Content-Type: application/json' \ -d '{}'{ "id": "clx9z8a1b0000abcd1234efgh", "name": "Pro plan (monthly)", "description": "Full access, billed every month.", "amount": "49.00", "asset": "native", "kind": "one_time", "active": true, "reference": "sku_pro_monthly", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}Deletes the product for good. To keep its record, set active: false with PATCH instead.
Requires the products:write scope.
apiKeyAuthorizationBearer <API key>Your Cosmos Pay secret API key, sent as Authorization: Bearer <apiKey>.
id*stringOK
The body, query or path failed validation. message is an array of the individual failures.
Routes that reject a valid request for a reason of their own (an amount, a memo, a state) document the code for it on their own 400.
no_authenticated_consumer: The gateway forwarded no API key identity
insufficient_scope: the API key does not hold the scope this route requires. The shared public API key also gets this on every route that is not marked x-cosmos-public-key, with a message saying so; more scopes will not help, the key is the wrong one.
gateway_required: the request did not arrive through APISIX.
No such resource, or it exists and belongs to another consumer. The two are deliberately the same answer: "exists but not yours" is an ownership oracle.
Unexpected server error. The detail is logged server-side and never returned: there is nothing in the body to branch on beyond the code.
curl -X DELETE 'https://api.cosmospay.lat/cosmos-api/v1/products/string'{ "id": "clx9z8a1b0000abcd1234efgh", "deleted": true}