CanopyDocs
Reference

Returns

GET
/api/clients/{id}/return-codes

Active reason codes for this client. Every line on a new RMA requires one of these ids, either on the line or as the RMA-level default.

Authorization

oauth2 returns:read
AuthorizationBearer <token>

OAuth2 client-credentials grant.

In: header

Scope: returns:read

Path Parameters

id*string

Client id

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/clients/string/return-codes"
{  "success": true,  "data": [    {      "id": "string",      "code": "string",      "description": "string",      "labelPolicy": "NOT_RETURNABLE",      "clientId": "string",      "isActive": true,      "internalUseOnly": true,      "requireCallStore": true    }  ]}
GET
/api/returns

Authorization

oauth2 returns:read
AuthorizationBearer <token>

OAuth2 client-credentials grant.

In: header

Scope: returns:read

Query Parameters

page?integer
Range0 < value
Default1
limit?integer
Range0 < value <= 500
Default20
search?string
sortBy?string
Lengthlength <= 50
sortOrder?string
Default"asc"

Value in

  • "asc"
  • "desc"
status?string
type?string

Value in

  • "CUSTOMER"
  • "RTS"
  • "BLIND"
missingTracking?string

Value in

  • "true"
  • "false"
clientId?string
orderId?string
reasonCodeId?string
dateFrom?string
dateTo?string

Header Parameters

X-Client-Id?string

Scope results to one client (brand). Resolve a client name to its id via GET /api/clients/lookup. Validated against the credential's tenant; ignored by a client-pinned credential.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/returns"
{  "success": true,  "data": [    {      "id": "string",      "clientId": "string",      "clientName": "string",      "clientCode": "string",      "warehouseId": "string",      "warehouseName": "string",      "orderId": "string",      "orderNumber": "string",      "rmaNumber": "string",      "externalReturnId": "string",      "externalSource": "SHOPIFY",      "type": "CUSTOMER",      "outboundShipmentId": "string",      "outboundShipment": {        "id": "string",        "trackingNumber": "string",        "carrierService": "string",        "status": "LABEL_CREATED"      },      "status": "PENDING",      "settlement": "RESEND_AS_IS",      "currency": "string",      "presentmentCurrency": "string",      "reasonCode": {        "id": "string",        "code": "string",        "description": "string",        "labelPolicy": "NOT_RETURNABLE"      },      "reasonNote": "string",      "customerName": "string",      "customerEmail": "string",      "customerPhone": "string",      "returnFromAddress": {        "name": "string",        "company": "string",        "line1": "string",        "line2": "string",        "city": "string",        "state": "string",        "zip": "string",        "country": "string",        "phone": "string"      },      "labelType": "STORE_PAID",      "trackingNumber": "string",      "carrierService": "string",      "returnShipment": {        "id": "string",        "trackingNumber": "string",        "carrierService": "string",        "labelUrl": "string",        "labelData": "string",        "labelFormat": "string"      },      "refundStatus": "NOT_REQUESTED",      "refundAmount": "string",      "refundIssuedAt": "2019-08-24T14:15:22Z",      "refundIssuedBy": {        "id": "string",        "firstName": "string",        "lastName": "string",        "email": "string"      },      "notes": "string",      "createdBy": {        "id": "string",        "firstName": "string",        "lastName": "string",        "email": "string"      },      "receivedBy": {        "id": "string",        "firstName": "string",        "lastName": "string",        "email": "string"      },      "completedAt": "2019-08-24T14:15:22Z",      "lineCount": 0,      "totalExpected": 0,      "totalReceived": 0,      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "pagination": {    "page": 0,    "limit": 0,    "total": 0,    "totalPages": 0  }}
POST
/api/returns

Tenant-wide credentials only. A credential pinned to one client is refused (403), as that client's portal users are; use a tenant-wide credential with X-Client-Id. Opens an RMA against one of the client's orders. Each line names the order line and the quantity expected back; type defaults to CUSTOMER. The client comes from the x-client-id header.

Authorization

oauth2 returns:write
AuthorizationBearer <token>

OAuth2 client-credentials grant.

In: header

Scope: returns:write

Header Parameters

Idempotency-Key?string

Optional client-supplied key that makes this write safe to retry. A replay of a completed key returns the original response; an in-flight duplicate gets 409. A key is bound to the operation — method, URL and request body — and to the caller — the credential and its token scopes; reusing it with any of those changed gets 422.

Lengthlength <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/returns" \  -H "Content-Type: application/json" \  -d '{    "lines": [      {        "skuId": "string",        "expectedQuantity": 1      }    ]  }'
{  "success": true,  "data": {    "id": "string",    "clientId": "string",    "clientName": "string",    "clientCode": "string",    "warehouseId": "string",    "warehouseName": "string",    "orderId": "string",    "orderNumber": "string",    "rmaNumber": "string",    "externalReturnId": "string",    "externalSource": "SHOPIFY",    "type": "CUSTOMER",    "outboundShipmentId": "string",    "outboundShipment": {      "id": "string",      "trackingNumber": "string",      "carrierService": "string",      "status": "LABEL_CREATED"    },    "status": "PENDING",    "settlement": "RESEND_AS_IS",    "currency": "string",    "presentmentCurrency": "string",    "reasonCode": {      "id": "string",      "code": "string",      "description": "string",      "labelPolicy": "NOT_RETURNABLE"    },    "reasonNote": "string",    "customerName": "string",    "customerEmail": "string",    "customerPhone": "string",    "returnFromAddress": {      "name": "string",      "company": "string",      "line1": "string",      "line2": "string",      "city": "string",      "state": "string",      "zip": "string",      "country": "string",      "phone": "string"    },    "labelType": "STORE_PAID",    "trackingNumber": "string",    "carrierService": "string",    "returnShipment": {      "id": "string",      "trackingNumber": "string",      "carrierService": "string",      "labelUrl": "string",      "labelData": "string",      "labelFormat": "string"    },    "refundStatus": "NOT_REQUESTED",    "refundAmount": "string",    "refundIssuedAt": "2019-08-24T14:15:22Z",    "refundIssuedBy": {      "id": "string",      "firstName": "string",      "lastName": "string",      "email": "string"    },    "notes": "string",    "createdBy": {      "id": "string",      "firstName": "string",      "lastName": "string",      "email": "string"    },    "receivedBy": {      "id": "string",      "firstName": "string",      "lastName": "string",      "email": "string"    },    "completedAt": "2019-08-24T14:15:22Z",    "lineCount": 0,    "totalExpected": 0,    "totalReceived": 0,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "lines": [      {        "id": "string",        "returnId": "string",        "orderLineId": "string",        "skuId": "string",        "skuCode": "string",        "skuName": "string",        "skuDescription": "string",        "skuBarcode": "string",        "skuImageUrl": "string",        "skuNonPhysical": true,        "lotTracked": true,        "storageRequirementIds": [          "string"        ],        "shippedLotIds": [          "string"        ],        "shippedLots": [          {            "id": "string",            "lotNumber": "string",            "expiresAt": "2019-08-24T14:15:22Z"          }        ],        "suggestedBins": [          {            "binId": "string",            "binLabel": "string",            "zoneName": "string",            "isPickable": true,            "source": "PICKED_FROM",            "lastHeldAt": "2019-08-24T14:15:22Z"          }        ],        "unitPrice": 0,        "expectedQuantity": 0,        "receivedQuantity": 0,        "status": "PENDING",        "reasonCodeId": "string",        "reasonCode": {          "id": "string",          "code": "string",          "description": "string",          "labelPolicy": "NOT_RETURNABLE"        },        "reasonNote": "string",        "refundType": "REFUND",        "isUnexpected": true,        "notes": "string",        "receipts": [          {            "id": "string",            "quantity": 0,            "inspectionResult": "UNDAMAGED",            "disposition": "RESTOCK",            "bin": {              "id": "string",              "label": "string"            },            "lot": {              "id": "string",              "lotNumber": "string"            },            "performedBy": {              "id": "string",              "firstName": "string",              "lastName": "string",              "email": "string"            },            "autoReceived": true,            "notes": "string",            "createdAt": "2019-08-24T14:15:22Z"          }        ]      }    ]  }}
GET
/api/returns/{id}

Authorization

oauth2 returns:read
AuthorizationBearer <token>

OAuth2 client-credentials grant.

In: header

Scope: returns:read

Path Parameters

id*string

Return id

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/returns/string"
{  "success": true,  "data": {    "id": "string",    "clientId": "string",    "clientName": "string",    "clientCode": "string",    "warehouseId": "string",    "warehouseName": "string",    "orderId": "string",    "orderNumber": "string",    "rmaNumber": "string",    "externalReturnId": "string",    "externalSource": "SHOPIFY",    "type": "CUSTOMER",    "outboundShipmentId": "string",    "outboundShipment": {      "id": "string",      "trackingNumber": "string",      "carrierService": "string",      "status": "LABEL_CREATED"    },    "status": "PENDING",    "settlement": "RESEND_AS_IS",    "currency": "string",    "presentmentCurrency": "string",    "reasonCode": {      "id": "string",      "code": "string",      "description": "string",      "labelPolicy": "NOT_RETURNABLE"    },    "reasonNote": "string",    "customerName": "string",    "customerEmail": "string",    "customerPhone": "string",    "returnFromAddress": {      "name": "string",      "company": "string",      "line1": "string",      "line2": "string",      "city": "string",      "state": "string",      "zip": "string",      "country": "string",      "phone": "string"    },    "labelType": "STORE_PAID",    "trackingNumber": "string",    "carrierService": "string",    "returnShipment": {      "id": "string",      "trackingNumber": "string",      "carrierService": "string",      "labelUrl": "string",      "labelData": "string",      "labelFormat": "string"    },    "refundStatus": "NOT_REQUESTED",    "refundAmount": "string",    "refundIssuedAt": "2019-08-24T14:15:22Z",    "refundIssuedBy": {      "id": "string",      "firstName": "string",      "lastName": "string",      "email": "string"    },    "notes": "string",    "createdBy": {      "id": "string",      "firstName": "string",      "lastName": "string",      "email": "string"    },    "receivedBy": {      "id": "string",      "firstName": "string",      "lastName": "string",      "email": "string"    },    "completedAt": "2019-08-24T14:15:22Z",    "lineCount": 0,    "totalExpected": 0,    "totalReceived": 0,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "lines": [      {        "id": "string",        "returnId": "string",        "orderLineId": "string",        "skuId": "string",        "skuCode": "string",        "skuName": "string",        "skuDescription": "string",        "skuBarcode": "string",        "skuImageUrl": "string",        "skuNonPhysical": true,        "lotTracked": true,        "storageRequirementIds": [          "string"        ],        "shippedLotIds": [          "string"        ],        "shippedLots": [          {            "id": "string",            "lotNumber": "string",            "expiresAt": "2019-08-24T14:15:22Z"          }        ],        "suggestedBins": [          {            "binId": "string",            "binLabel": "string",            "zoneName": "string",            "isPickable": true,            "source": "PICKED_FROM",            "lastHeldAt": "2019-08-24T14:15:22Z"          }        ],        "unitPrice": 0,        "expectedQuantity": 0,        "receivedQuantity": 0,        "status": "PENDING",        "reasonCodeId": "string",        "reasonCode": {          "id": "string",          "code": "string",          "description": "string",          "labelPolicy": "NOT_RETURNABLE"        },        "reasonNote": "string",        "refundType": "REFUND",        "isUnexpected": true,        "notes": "string",        "receipts": [          {            "id": "string",            "quantity": 0,            "inspectionResult": "UNDAMAGED",            "disposition": "RESTOCK",            "bin": {              "id": "string",              "label": "string"            },            "lot": {              "id": "string",              "lotNumber": "string"            },            "performedBy": {              "id": "string",              "firstName": "string",              "lastName": "string",              "email": "string"            },            "autoReceived": true,            "notes": "string",            "createdAt": "2019-08-24T14:15:22Z"          }        ]      }    ],    "inspectionBins": [      {        "binId": "string",        "binLabel": "string",        "zoneName": "string"      }    ],    "brandAreaBins": [      {        "binId": "string",        "binLabel": "string",        "zoneName": "string"      }    ],    "outboundSync": {      "status": "PENDING",      "attempts": 0,      "lastError": "string",      "lastAttemptAt": "2019-08-24T14:15:22Z",      "nextRunAt": "2019-08-24T14:15:22Z"    }  }}