Add a warranty to an order
post
https://api.cartirra.com/v1/orders/{id}/warrantiesAdd a warranty to a paid order: for one of its lines, or an item by name.
- Authentication
- Secret key (
Authorization: Bearer sk_…). How keys work - Permission
warranties:write
Path parameters
idstringrequired
Request body required
JSON (Content-Type: application/json).
serial_numberstringnullablestarts_onstringFirst covered day; defaults to the day the order was paid
ends_onstringLast covered day; or give months or days
termsstringnullablecovered_bystringproviderstringnullableline_indexnumberThe order line it covers (its name is used unless item_name is given)
item_namestringRequired without line_index
monthsnumberdaysnumber
Responses
201CreatedWarrantyResponse
idstringrequiredreferencestringrequiredorderWarrantyOrderRefrequiredstore_idstring (uuid)requiredcustomer_idstring (uuid)nullableline_indexnumbernullableThe order line it covers
item_namestringrequiredserial_numberstringnullablestarts_onstringrequiredFirst covered day (Lagos)
ends_onstringrequiredLast covered day (Lagos)
termsstringnullablecovered_bystringrequiredproviderstringnullablesourcestringrequiredFrom the checkout line, or added afterwards
statestringrequiredending_soon: 30 days or less left
void_reasonstringnullablecreated_atstringrequiredupdated_atstringrequired
Errors
Every error has the same body: { "error": { "code", "message", "details"?, "request_id" } }. See Errors for every code.
- 400The request is malformed or a field is invalid (`VALIDATION_FAILED`).
- 401Missing, malformed, revoked or expired API key (`UNAUTHENTICATED`), or a key this route does not accept, such as a public key (`CREDENTIAL_NOT_ACCEPTED`).
- 403The key may not do this (`PERMISSION_DENIED`, `LIVE_MODE_NOT_ENABLED`, `PLAN_LIMIT_REACHED`, …).
- 404No such resource in this business and mode (`NOT_FOUND`).
- 409The resource is in a state that does not allow this (for example `ORDER_NOT_CANCELLABLE`, `REFUND_NOT_ALLOWED`).
- 422The request is valid but breaks a business rule.
- 429Too many requests for this key (`RATE_LIMITED`); wait for `Retry-After` seconds.
- 500Something went wrong on our side (`INTERNAL`). Safe to retry with the same `Idempotency-Key`.