Confirm a Shipment
شرح نقطههای پایانی در مرجع API به انگلیسی است؛ واژهها و قالبها همان است که در پاسخها میبینید.
نمونهها نشانی محیط اصلی را دارند، اما «امتحان کنید» همان درخواست را فقط به محیط آزمایشی میفرستد. کلید محرمانه شما نه در این سایت ذخیره میشود و نه در گزارشهای آن میآید.
Confirms a Shipment awaiting confirmation, within 72 hours of payment. Past confirmBy it is 409 SHIPMENT_CONFIRMATION_LAPSED, with the confirmBy in details, and the sweep cancels it. Repeating a step already made answers the Shipment unchanged; any other step its status doesn't allow is 409 SHIPMENT_NOT_IN_STATUS, with the status in details. A missing Shipment, another Seller's, or one of an Order not paid is 404 SHIPMENT_NOT_FOUND, with the shipmentId in details. The call needs a token of the chasbi realm whose Account holds the Seller power ORDERS: the owner, or a Seller Member with the role MANAGER or ORDERS; or an access token of the chasbi-partners realm for an API Key of the Seller with the role MANAGER or ORDERS. Any other token is refused with ACCESS_DENIED.
oauth2AuthorizationBearer <token>An access token of the chasbi-partners realm, made by the client-credentials grant with an API Key's client id and secret in the Authorization: Basic header. It lives five minutes and comes with no refresh token: ask for a new one when it ends.
shipmentId*stringThe id of the Shipment.
uuidIdempotency-Key?stringMakes the call safe to repeat. Send a new key with every new request, such as a random UUID, as a Structured Field String (RFC 9651): 1 to 255 printable ASCII characters in double quotes, with \" and \\ escaped, as in "8e03978e-40d5-43e8-bc93-6894a57f9324". Chasbi keeps each key for 24 hours from the start of the request it runs, for the caller whose token sent it.
Within 24 hours, the same key with the same method, path, query and body, byte for byte, gets the first answer again, with its status, Location and body and the header Idempotent-Replayed: true, and the call isn't made a second time. A body serialized differently is another request. That holds for a refusal (4xx) too, so after a refusal, send a new key once you've changed anything; an answer of 500 or more isn't kept, so the request may be sent again with the same key. The same key with another request is 422 IDEMPOTENCY_KEY_REUSED. While the first request with the key is still being processed, the key is 409 IDEMPOTENCY_KEY_IN_USE; send the request again in a moment. If the first request hasn't answered 5 minutes after it started, it is taken as lost, and the same key runs the request again. A value that isn't such a string is 400 VALIDATION_FAILED, with TYPE_MISMATCH for Idempotency-Key. With the header, a JSON body over 1 MiB is 413 CONTENT_TOO_LARGE. Without the header, the call is made every time it is sent.
The Shipment as it now stands.
application/json- response
One of a Seller's Shipments, with the recipient as its data window shows it.
cancellationPenalty?What cancelling it would cost the Seller, while the Seller can still cancel it and a penalty would apply.
cancellationReason?stringWhy it was cancelled, once it was: OUT_OF_STOCK, CANNOT_SHIP_TO_ADDRESS or PRICE_ENTERED_WRONGLY from its Seller, BUYER_REQUEST from an Operator, OTHER from either, or CONFIRMATION_DEADLINE_MISSED from the 72-hour sweep. A Buyer's own earlier Cancellation reads BUYER_REQUEST.
"OUT_OF_STOCK""CANNOT_SHIP_TO_ADDRESS""PRICE_ENTERED_WRONGLY""BUYER_REQUEST""OTHER""CONFIRMATION_DEADLINE_MISSED""PAYMENT_REVERSED"cancelledAt?stringWhen it was cancelled, once it was.
date-timecancelledBy?stringWho cancelled it: the Seller, an Operator, or the confirmation deadline. BUYER marks a Cancellation its Buyer made before Buyers stopped cancelling; nothing records it any more.
"BUYER""SELLER""OPERATOR""CONFIRMATION_DEADLINE"cancelledByAccount?Who of the Seller's team shipped the Shipment, once it was shipped after Seller Members arrived.
confirmBy?stringWhen the Seller must confirm by, once the Order is paid.
date-timeconfirmedAt?stringWhen the Seller confirmed it, once it did.
date-timeconfirmedByAccount?Who of the Seller's team shipped the Shipment, once it was shipped after Seller Members arrived.
deliveredAt?stringWhen it was Delivered, once it was.
date-timedeliveryConfirmation?stringHow it came to be Delivered: the Buyer confirmed, or seven days passed.
"BY_BUYER""AFTER_SEVEN_DAYS"deliveryFrom*stringThe first day delivery may come, in Tehran.
datedeliveryTo*stringThe last day delivery may come, in Tehran.
datedispatchDay*stringThe day it leaves, or left, in Tehran.
dateid*stringThe id of the Shipment.
uuiditemsTotal*integerThe lines' total. In whole Rial.
int64lines*array<>What the Shipment holds.
net*integerWhat the Shipment owes its Seller: the lines' total and the shipping fee, less the lines' Commission and its VAT. The transfer fee comes off each Transfer, not here. In whole Rial.
int64orderNumber*integerThe number of its Order; people know a Shipment as this number and its position.
int64paidAt*stringWhen its Order was paid.
date-timeposition*integerIts position in the Order, from 1.
int32recipient*The recipient, as the data window shows it.
shippedAt?stringWhen it shipped, once it did.
date-timeshippedByAccount?Who of the Seller's team shipped the Shipment, once it was shipped after Seller Members arrived.
shipping*The Shipping Method as ordered.
status*stringWhere it stands.
"AWAITING_PAYMENT""AWAITING_CONFIRMATION""CONFIRMED""SHIPPED""DELIVERED""CANCELLED""UNPAID"trackingCode?stringThe Tracking Code it shipped with, if any. It reads left to right.
curl -X POST 'https://api.chasbi.com/v1/me/seller/shipments/497f6eca-6276-4993-bfeb-53cbbbba6f08/confirm' \ -H 'Idempotency-Key: "8e03978e-40d5-43e8-bc93-6894a57f9324"'{ "cancellationPenalty": { "ifCancelledNow": { "commission": 0, "multiplier": 0, "penalty": 0, "total": 0, "vat": 0 }, "ifConfirmationLapses": { "commission": 0, "multiplier": 0, "penalty": 0, "total": 0, "vat": 0 } }, "cancellationReason": "OUT_OF_STOCK", "cancelledAt": "2019-08-24T14:15:22Z", "cancelledBy": "BUYER", "cancelledByAccount": { "apiKey": true, "name": "string", "owner": true }, "confirmBy": "2019-08-24T14:15:22Z", "confirmedAt": "2019-08-24T14:15:22Z", "confirmedByAccount": { "apiKey": true, "name": "string", "owner": true }, "deliveredAt": "2019-08-24T14:15:22Z", "deliveryConfirmation": "BY_BUYER", "deliveryFrom": "2019-08-24", "deliveryTo": "2019-08-24", "dispatchDay": "2019-08-24", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "itemsTotal": 0, "lines": [ { "commission": 0, "commissionVat": 0, "lineTotal": 0, "offerId": "42da58f8-9040-4cf5-98ce-bce9965cca0d", "quantity": 0, "unitPrice": 0, "variant": { "axisValues": [ { "axis": { "fa": "string" }, "number": "string", "option": { "fa": "string" }, "unit": { "fa": "string" } } ], "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "mainImageId": "cd398d71-4443-4270-9f21-bcc59332a255", "productId": "dcd53ddb-8104-4e48-8cc0-5df1088c6113", "productName": { "fa": "string" } } } ], "net": 0, "orderNumber": 0, "paidAt": "2019-08-24T14:15:22Z", "position": 0, "recipient": { "addressLine": "string", "city": "string", "name": "string", "phone": "string", "plate": "string", "postalCode": "string", "province": "ALBORZ", "shown": "FULL", "unit": "string" }, "shippedAt": "2019-08-24T14:15:22Z", "shippedByAccount": { "apiKey": true, "name": "string", "owner": true }, "shipping": { "fee": 0, "maxDays": 0, "minDays": 0, "reach": "SAME_CITY", "shippingMethodId": "ea3a5f49-4f0a-4467-bd32-114aa00d0649", "shippingMethodTypeId": "97e0df88-c5cd-415e-bb88-913ad75eea3c", "typeName": { "fa": "string" } }, "status": "AWAITING_PAYMENT", "trackingCode": "string"}