API reference › Returns

POST/shipments/{id}/return-charge/settle

RET: a return charged to its seller — you settled it (withheld from the payout, or paid by the seller)

Only a return booked with payer seller by a platform paid on the platform (return.charge due). method withheld — withheld from the seller's payout, as your terms with the seller allow — or paid by the seller; IDS records your method, it neither prescribes nor endorses a withholding. The same method and reference again answer the same (changed false); another → 409 RETURN_CHARGE_ALREADY_SETTLED. A return cancelled before the carrier took it has its charge void (409 RETURN_CHARGE_VOID). IDS never charges a balance for it.

Key scope
shipments:write
Idempotency-Key
Not used
URL
https://ids.express/api/v1/shipments/{id}/return-charge/settle

Parameters

  • idpath · stringrequired

    Shipment UUID or its master tracking number

Request body

Unknown fields are rejected (400 VALIDATION_FAILED, details[].path names the field).

application/json — ReturnChargeSettleRequest

  • methodstringrequired

    one of: withheld · paid

    withheld — you withheld it from the seller's payout, as your terms with the seller allow; paid — the seller paid it. IDS records your method; it neither prescribes nor endorses a withholding.

  • referencestringrequiredlength 1–100pattern ^[^\u0000-\u001F\u007F-\u009F\u2028\u2029]+$

    Your own id of the settlement (the payout or the payment).

Call it

curl -s -X POST "https://ids.express/api/v1/shipments/$ID/return-charge/settle" \
  -H "Authorization: Bearer $IDS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "method": "withheld",
  "reference": "<reference>"
}'

Answers

200 { shipmentId, changed, return }

Headers: X-Request-Id

application/json — ReturnChargeSettled

  • shipmentIdstring (uuid)required
  • changedbooleanrequired

    false: the same settlement was recorded already.

  • returnobjectrequirednullable
  • ofobjectrequired

    The original shipment it returns.

  • idstring (uuid)required
  • masterTrackingNumberstringrequirednullable
  • payerstringrequired

    one of: buyer · seller · platform · account

    Who bears it as you named it (IDS never decides it).

  • reasonstringrequired

    one of: withdrawal · defect · damaged · not_delivered · other

  • reasonNotestringrequirednullable
  • handoverstringrequired

    one of: pickup · drop_off

  • dropOffPointobject (free-form)requirednullable

    The point you named at booking (handover.dropOffPoint), as sent.

  • carrierReturnLabelbooleanrequired

    Booked as the carrier's own return label (associated with the original).

  • customsReasonstringrequirednullable

    one of: REJECTED · FAULTY_ITEM · OTHER · null

    Between two countries (with the customs lines — the carrier requires it): the return's reason as customs recognises it; null for a domestic return.

  • chargeobjectrequirednullable

    payer seller of a platform paid on the platform: the charge you settle (POST /shipments/{id}/return-charge/settle); null for any other payer.

  • statusstringrequired

    one of: due · settled · void

  • amountnumberrequirednullable
  • amountMinorintegerrequirednullable

    The amount beside it in minor units (cents).

  • currencystringrequirednullable
  • settledMethodstringrequirednullable

    one of: withheld · paid · null

  • settledReferencestringrequirednullable
  • settledAtstring (date-time)requirednullable
  • voidedAtstring (date-time)requirednullable
  • createdAtstring (date-time)required
400 VALIDATION_FAILED — method, reference, an unknown field

Headers: X-Request-Id

Codes: VALIDATION_FAILED

The error envelope — Error (error.code, message, retryable, details, requestId); the codes below.

401 AUTHENTICATION_FAILED — missing, malformed, invalid, revoked or expired key

Headers: X-Request-Id

Codes: AUTHENTICATION_FAILED

The error envelope — Error (error.code, message, retryable, details, requestId); the codes below.

403 API_ACCESS_DISABLED / API_ACCOUNT_DISABLED / API_KEY_IP_NOT_ALLOWED / API_TERMS_NOT_ACCEPTED / FORBIDDEN_SCOPE / API_OWNER_NOT_BILLABLE; a platform's key: PLATFORM_SUSPENDED (a quote, booking or test operation of a suspended platform) / PLATFORM_TARIFF_MISSING (a quote or booking before IDS set its tariff)

Headers: X-Request-Id

Codes: API_ACCESS_DISABLEDAPI_ACCOUNT_DISABLEDAPI_KEY_IP_NOT_ALLOWEDAPI_TERMS_NOT_ACCEPTEDFORBIDDEN_SCOPEAPI_OWNER_NOT_BILLABLEPLATFORM_SUSPENDEDPLATFORM_TARIFF_MISSING

The error envelope — Error (error.code, message, retryable, details, requestId); the codes below.

404 NOT_FOUND — not visible to this key (other account or other environment)

Headers: X-Request-Id

Codes: NOT_FOUND

The error envelope — Error (error.code, message, retryable, details, requestId); the codes below.

409 RETURN_CHARGE_NOT_DUE / RETURN_CHARGE_VOID / RETURN_CHARGE_ALREADY_SETTLED

Headers: X-Request-Id

Codes: RETURN_CHARGE_NOT_DUERETURN_CHARGE_VOIDRETURN_CHARGE_ALREADY_SETTLED

The error envelope — Error (error.code, message, retryable, details, requestId); the codes below.

429 RATE_LIMITED — per-key or per-IP limit exceeded; wait Retry-After seconds

Headers: X-Request-IdRetry-After

Codes: RATE_LIMITED

The error envelope — Error (error.code, message, retryable, details, requestId); the codes below.

500 INTERNAL_ERROR

Headers: X-Request-Id

Codes: INTERNAL_ERROR

The error envelope — Error (error.code, message, retryable, details, requestId); the codes below.

503 API_DISABLED (API switched off); CARRIER_NOT_CONFIGURED / CURRENCY_RATE_MISSING where a carrier or FX rate is used

Headers: X-Request-Id

Codes: API_DISABLEDCARRIER_NOT_CONFIGUREDCURRENCY_RATE_MISSING

The error envelope — Error (error.code, message, retryable, details, requestId); the codes below.

Error codes of this operation

The codes the answers of this operation name. Always read error.retryable of the answer itself — «varies» means it differs per answer. The gates of every keyed request (401, 403, 429, 503) and the whole catalog: errors.

  • VALIDATION_FAILEDHTTP 400retryable: nodetails: ValidationIssuesdetails: ServiceRefusal

    The request is invalid: a field (details[].path), an unknown field, a missing Idempotency-Key, a body that is not JSON, an address the label cannot print. Fix it; repeating it unchanged fails again.

  • AUTHENTICATION_FAILEDHTTP 401retryable: no

    Missing, malformed, invalid, revoked or expired key; an environment tag that does not match. (An account switched off answers 403 API_ACCOUNT_DISABLED since SEC.)

  • API_ACCESS_DISABLEDHTTP 403retryable: no

    API access is switched off for this account.

  • API_ACCOUNT_DISABLEDHTTP 403retryable: no

    The IDS account of this key is switched off, not approved or closed (for an employee's key: its franchise owner's account) — the key stops with it; contact IDS.

  • API_KEY_IP_NOT_ALLOWEDHTTP 403retryable: no

    IDS keeps a list of IP addresses for this key and the request came from another one — send it from a listed address, or ask IDS to change the list.

  • API_TERMS_NOT_ACCEPTEDHTTP 403retryable: no

    The IDS account of this key has not accepted the API Terms of Use (/legal/api-terms) — its holder accepts them in the IDS cabinet (Integrations / API), or IDS records a signed agreement (for an employee's key: its franchise owner's account). Retrying does not help until then.

  • FORBIDDEN_SCOPEHTTP 403retryable: no

    The key lacks the scope of this operation (x-scope).

  • API_OWNER_NOT_BILLABLEHTTP 403retryable: no

    The account cannot be billed through the API (no pricing tier, or an admin account).

  • PLATFORM_SUSPENDEDHTTP 403retryable: no

    The platform of this key is suspended by IDS: quotes, bookings and test operations are refused until IDS resumes it; reads, the tracking refresh, a cancellation and a complaint still work. A retry of a booking finished before the suspension replays its answer.

  • PLATFORM_TARIFF_MISSINGHTTP 403retryable: no

    The platform has no tariff yet — IDS sets it; no quote or booking until then.

  • NOT_FOUNDHTTP 404retryable: no

    Unknown path, or an object this key may not see (another account, the other environment).

  • RETURN_CHARGE_NOT_DUEHTTP 409retryable: no

    This return is not charged to its seller — there is nothing to settle.

  • RETURN_CHARGE_VOIDHTTP 409retryable: no

    The return was cancelled before the carrier took the parcel: its charge to the seller is void (give back what you withheld).

  • RETURN_CHARGE_ALREADY_SETTLEDHTTP 409retryable: nodetails: ReturnChargeSettledDetails

    The return's charge was settled already with another method or reference (details) — the same settlement repeated answers 200.

  • RATE_LIMITEDHTTP 429retryable: yes

    A limit per minute — the key's requests, its quotes, its platform's keys together, or the client IP (limitScope) — wait Retry-After seconds (retryAfterSec, limit).

  • INTERNAL_ERRORHTTP 500retryable: no

    Unexpected — for a booking, check GET /shipments before using a new key; quote the requestId.

  • API_DISABLEDHTTP 503retryable: no

    IDS switched the whole API off (/ping and /openapi.json keep answering).

  • CARRIER_NOT_CONFIGUREDHTTP 503retryable: no

    The carrier credentials of this environment are missing.

  • CURRENCY_RATE_MISSINGHTTP 503retryable: no

    IDS has no exchange rate for the balance currency.