رفتن به محتوا
چسبیتوسعه‌دهندگان
درخواست‌های مرجوعی

Confirm the posted items came back, or report an issue

شرح نقطه‌های پایانی در مرجع API به انگلیسی است؛ واژه‌ها و قالب‌ها همان است که در پاسخ‌ها می‌بینید.

نمونه‌ها نشانی محیط اصلی را دارند، اما «امتحان کنید» همان درخواست را فقط به محیط آزمایشی می‌فرستد. کلید محرمانه شما نه در این سایت ذخیره می‌شود و نه در گزارش‌های آن می‌آید.

POST
/v1/me/seller/return-requests/{returnRequestId}/receipt

RECEIVED decides the Refund; ISSUE sends the request to Chasbi, NOT_ARRIVED included. Every bad value is reported at once as 422 INVALID_VALUES. An issue other than NOT_ARRIVED needs photos uploaded by a person of the Seller, which an API Key can't upload, so a key reports RECEIVED or the issue NOT_ARRIVED, and an issue with photos is reported in the Seller panel. Another Seller's request is 404 RETURN_REQUEST_NOT_FOUND. A request no longer in a status that takes the act is 409 RETURN_REQUEST_ALREADY_MOVED, with its status; a stale version is 409 STALE_WRITE. 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.

احراز هویت

oauth2
headerAuthorizationBearer <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.

پارامترهای مسیر

returnRequestId*string

The id of the Return Request.

قالبuuid

پارامترهای سرآیند

Idempotency-Key?string

Makes 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.

بدنه درخواست

application/json
  1. body

What the Seller found when the posted items came back.

issue?string

With ISSUE, what is wrong (RETURN_ISSUE_REQUIRED). OPENED only for a change of mind (409 RETURN_ISSUE_NOT_FOR_REASON).

مقدار در"USED""DAMAGED""OPENED""PARTS_MISSING""NOT_ARRIVED"
note?string

An optional note at most 1,000 characters long that only Operators read. It holds no phone number, national ID or Sheba (NOTE_HAS_PERSONAL_DATA).

طولlength <= 1000
outcome*string

RECEIVED when the items came back as expected, which decides the Refund; ISSUE sends the request to Chasbi.

مقدار در"RECEIVED""ISSUE"
photoIds?array<>

With an issue other than NOT_ARRIVED, 1 to 5 photos uploaded as RETURN_PHOTO, which only Operators see; none otherwise.

اعضاitems <= 5
version*integer

The version of the Return Request the act is based on, as the last read returned it. Another value is refused with STALE_WRITE.

قالبint64

بدنه پاسخ

The request.

application/json
  1. response

One of the Seller's Return Requests, with what the Seller may read of it.

acceptOffered*boolean

Whether the Seller may accept the problem (/answer with accept).

accepted?boolean

Whether the answer accepted it.

answerDue?string

While it waits for the Seller's answer, its deadline; silence accepts.

قالبdate-time
answeredBy?string

Who answered the problem: the Seller or its silence (SYSTEM).

مقدار در"BUYER""SELLER""OPERATOR""SYSTEM"
conditionReason?string

The condition Chasbi decided.

مقدار در"USED""DAMAGED""OPENED""PARTS_MISSING"
deadline?string

The deadline of what it waits for.

قالبdate-time
deliveryAddress?

After «بدون بازپرداخت», where to send the items back, until the sending is recorded.

endedAt?string

When it ended.

قالبdate-time
fault?string

Once accepted, whether it is the Seller's fault.

مقدار در"NONE""SELLER"
id*string

The id of the Return Request.

قالبuuid
lines*array<>

The lines sent back.

money?

The money decided.

number*integer

The request's number «کد مرجوعی».

قالبint64
openedAt*string

When it was opened.

قالبdate-time
orderId*string

The Order.

قالبuuid
orderNumber*integer

The Order's number.

قالبint64
photos*array<>

The Buyer's photos of the problem and the Seller's own of returned items.

postBy?string

Once accepted, when the Buyer must post by.

قالبdate-time
posting?

How the items were posted.

reason*string

Why the items go back.

مقدار در"CHANGE_OF_MIND""DAMAGED""NOT_AS_ORDERED""NOT_GENUINE""MISSING_PARTS"
receiptDecision?string

Chasbi's decision on it.

مقدار در"FULL_REFUND""PARTIAL_REFUND""NO_REFUND""RECEIVED""WAIT"
receiptDue?string

Once posted, when the Seller must confirm receipt by; silence confirms it.

قالبdate-time
receiptIssue?string

The issue the Seller reported.

مقدار در"USED""DAMAGED""OPENED""PARTS_MISSING""NOT_ARRIVED"
receiptIssueOffered*boolean

Whether the Seller may still report an issue with what came back: until its receipt deadline, after which its silence has confirmed receipt.

receiptIssueOffers*array<>

The issues the Seller may report for this request's reason, with the photos each takes.

receiptOffered*boolean

Whether the Seller may confirm receipt «تحویل گرفتم» (/receipt with RECEIVED).

refusalOffered*boolean

Whether the Seller may still refuse it: until its answer deadline, after which its silence has accepted it.

refusalReasonOffers*array<>

The reasons the Seller may refuse with, and which needs a note.

returnAddress?

The return address copied at acceptance.

sendBackDue?string

After «بدون بازپرداخت», when the Seller must send the items back by.

قالبdate-time
sendBackOffered*boolean

Whether the Seller must record the items sent back to the Buyer (/sent-back).

sentBack?

The items sent back to the Buyer.

shipmentId*string

The Shipment.

قالبuuid
shipmentPosition*integer

The Shipment's position in its Order.

قالبint32
status*string

Where the request stands.

مقدار در"AWAITING_SELLER""AWAITING_OPERATOR""AWAITING_RETURN_ADDRESS""ACCEPTED""POSTED""RECEIPT_DISPUTED""REFUNDING""REFUNDED""NOT_REFUNDED""REFUSED""WITHDRAWN""LAPSED"
tab*string

The tab that lists it.

مقدار در"TO_ANSWER""AT_CHASBI""TO_BE_POSTED""POSTED""TO_SEND_BACK""CLOSED"
trackingCode?string

Once posted, the post's Tracking Code.

version*integer

The version an act names.

قالبint64
waiting*boolean

Whether it waits for the Seller.

waitingKind?string

What the Seller must do.

مقدار در"RETURN_REQUEST_TO_POST""RETURN_REQUEST_TO_ANSWER""RETURN_REQUEST_TO_RECEIVE""RETURN_REQUEST_TO_SEND_BACK""RETURN_REQUEST_TO_DECIDE""RETURN_REQUEST_ADDRESS_MISSING"
نمونه درخواست
curl -X POST 'https://api.chasbi.com/v1/me/seller/return-requests/497f6eca-6276-4993-bfeb-53cbbbba6f08/receipt' \  -H 'Idempotency-Key: "8e03978e-40d5-43e8-bc93-6894a57f9324"' \  -H 'Content-Type: application/json' \  -d '{  "outcome": "RECEIVED",  "version": 0}'
نمونه پاسخ
{  "acceptOffered": true,  "accepted": true,  "answerDue": "2019-08-24T14:15:22Z",  "answeredBy": "BUYER",  "conditionReason": "USED",  "deadline": "2019-08-24T14:15:22Z",  "deliveryAddress": {    "addressLine": "string",    "city": "string",    "plate": "string",    "postalCode": "string",    "province": "ALBORZ",    "recipient": "string",    "unit": "string"  },  "endedAt": "2019-08-24T14:15:22Z",  "fault": "NONE",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "lines": [    {      "bought": 0,      "mainImageId": "cd398d71-4443-4270-9f21-bcc59332a255",      "position": 0,      "quantity": 0,      "title": {        "fa": "string"      },      "unitPrice": 0,      "values": [        {          "axis": {            "fa": "string"          },          "number": "string",          "option": {            "fa": "string"          },          "unit": {            "fa": "string"          }        }      ]    }  ],  "money": {    "decidedAt": "2019-08-24T14:15:22Z",    "decidedBy": "BUYER",    "itemsRial": 0,    "keptBackRial": 0,    "postageRial": 0,    "refundRial": 0,    "shippingFeeRial": 0  },  "number": 0,  "openedAt": "2019-08-24T14:15:22Z",  "orderId": "b3e1eced-f2bd-4d8c-9765-fbc9d1d222d5",  "orderNumber": 0,  "photos": [    {      "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad",      "party": "BUYER"    }  ],  "postBy": "2019-08-24T14:15:22Z",  "posting": {    "postageCapRial": 0,    "postageRial": 0,    "postedOn": "2019-08-24",    "trackingCode": "string"  },  "reason": "CHANGE_OF_MIND",  "receiptDecision": "FULL_REFUND",  "receiptDue": "2019-08-24T14:15:22Z",  "receiptIssue": "USED",  "receiptIssueOffered": true,  "receiptIssueOffers": [    {      "issue": "USED",      "photosMax": 0,      "photosMin": 0    }  ],  "receiptOffered": true,  "refusalOffered": true,  "refusalReasonOffers": [    {      "noteRequired": true,      "reason": "SENT_AS_ORDERED"    }  ],  "returnAddress": {    "addressLine": "string",    "city": "string",    "postalCode": "string",    "province": "ALBORZ",    "recipient": "string"  },  "sendBackDue": "2019-08-24T14:15:22Z",  "sendBackOffered": true,  "sentBack": {    "sentBackAt": "2019-08-24T14:15:22Z",    "trackingCode": "string"  },  "shipmentId": "47efd5a2-af91-4417-950a-7f546cd1b5cf",  "shipmentPosition": 0,  "status": "AWAITING_SELLER",  "tab": "TO_ANSWER",  "trackingCode": "string",  "version": 0,  "waiting": true,  "waitingKind": "RETURN_REQUEST_TO_POST"}