Przejdź do głównej zawartości

Utwórz zwrot na podstawie zamówienia

POST
/api/v3/returns/fromOrder
curl --request POST \
--url https://twoja-instancja-smerp-api.enterprise.sellrocket.pl/api/v3/returns/fromOrder \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "orderId": 1, "orderLineItems": [ { "id": 1, "quantity": 1, "name": "example", "price": 1, "returnsReasonId": 1, "returnsPositionStatusId": 1, "clientNote": "example" } ], "returnParams": { "sourcePlatformReturnId": "example", "referenceNumber": "example", "externalPackage": true, "buyerComment": "example", "useDeliveryCostsFromOrder": true, "additionalField1": "example", "additionalField2": "example", "packStationId": 1, "orderReturnAccountNumber": "example", "orderReturnIBan": "example", "orderReturnSwitft": "example", "sellerComments": [ "example" ], "fulfillmentStatus": 1, "returnStatusId": 1, "buyerEmail": "example", "buyerUsername": "example", "buyerPhone": "example", "recipientFirstName": "example", "recipientLastName": "example", "recipientCompanyName": "example", "recipientPhone": "example", "recipientApartmentNo": "example", "recipientHouseNo": "example", "recipientStreet": "example", "recipientCity": "example", "recipientPostCode": "example", "recipientState": "example", "recipientCountryCode": "example", "deliveryCostAmount": 1, "summaryAmount": 1, "additionalFields": [ { "fieldName": "example", "fieldType": "example", "fieldValue": "example", "additionalFieldDefinition": { "fieldName": "example", "fieldDisplayName": "example", "fieldType": "example", "predefinedValues": [ "example" ] } } ], "payments": [ { "platformId": "example", "platformName": "example", "finishedAtUtc": "2026-04-15T12:00:00Z", "currency": "example", "amount": 1 } ] } }'

Tworzy zwrot z danymi i pozycjami przeniesionymi z zamówienia. Operacja asynchroniczna – zwraca zadanie (job), którego wynik sprawdzisz w Zadaniach asynchronicznych.

Typ treściapplication/json
object
orderId
integer format: int64
orderLineItems
Array<object>
nullable
object
id
integer format: int64
quantity
integer format: int64
name
string
nullable
price
number format: double
nullable
returnsReasonId
integer format: int64
returnsPositionStatusId
integer format: int64
clientNote
string
nullable
returnParams
object
sourcePlatformReturnId
string
nullable
referenceNumber
string
nullable
externalPackage
boolean
buyerComment
string
nullable <= 1024 characters
useDeliveryCostsFromOrder
boolean
additionalField1
string
nullable
additionalField2
string
nullable
packStationId
integer format: int64
nullable
orderReturnAccountNumber
string
nullable
orderReturnIBan
string
nullable
orderReturnSwitft
string
nullable
sellerComments
Array<string>
nullable
fulfillmentStatus
integer format: int32
nullable
returnStatusId
integer format: int64
nullable
buyerEmail
string
nullable
buyerUsername
string
nullable
buyerPhone
string
nullable
recipientFirstName
string
nullable
recipientLastName
string
nullable
recipientCompanyName
string
nullable
recipientPhone
string
nullable
recipientApartmentNo
string
nullable
recipientHouseNo
string
nullable
recipientStreet
string
nullable
recipientCity
string
nullable
recipientPostCode
string
nullable
recipientState
string
nullable
recipientCountryCode
string
nullable
deliveryCostAmount
number format: double
nullable
summaryAmount
number format: double
nullable
additionalFields
Array<object>
nullable
object
fieldName
string
nullable
fieldType
string
nullable
fieldValue
string
nullable
additionalFieldDefinition
object
fieldName
string
nullable
fieldDisplayName
string
nullable
fieldType
string
nullable
predefinedValues
Array<string>
nullable
payments
Array<object>
nullable
object
platformId
string
nullable
platformName
string
nullable
finishedAtUtc
string format: date-time
nullable
currency
string
nullable
amount
number format: double
Examplegenerated
{
"orderId": 1,
"orderLineItems": [
{
"id": 1,
"quantity": 1,
"name": "example",
"price": 1,
"returnsReasonId": 1,
"returnsPositionStatusId": 1,
"clientNote": "example"
}
],
"returnParams": {
"sourcePlatformReturnId": "example",
"referenceNumber": "example",
"externalPackage": true,
"buyerComment": "example",
"useDeliveryCostsFromOrder": true,
"additionalField1": "example",
"additionalField2": "example",
"packStationId": 1,
"orderReturnAccountNumber": "example",
"orderReturnIBan": "example",
"orderReturnSwitft": "example",
"sellerComments": [
"example"
],
"fulfillmentStatus": 1,
"returnStatusId": 1,
"buyerEmail": "example",
"buyerUsername": "example",
"buyerPhone": "example",
"recipientFirstName": "example",
"recipientLastName": "example",
"recipientCompanyName": "example",
"recipientPhone": "example",
"recipientApartmentNo": "example",
"recipientHouseNo": "example",
"recipientStreet": "example",
"recipientCity": "example",
"recipientPostCode": "example",
"recipientState": "example",
"recipientCountryCode": "example",
"deliveryCostAmount": 1,
"summaryAmount": 1,
"additionalFields": [
{
"fieldName": "example",
"fieldType": "example",
"fieldValue": "example",
"additionalFieldDefinition": {
"fieldName": "example",
"fieldDisplayName": "example",
"fieldType": "example",
"predefinedValues": [
"example"
]
}
}
],
"payments": [
{
"platformId": "example",
"platformName": "example",
"finishedAtUtc": "2026-04-15T12:00:00Z",
"currency": "example",
"amount": 1
}
]
}
}

Success

Typ treściapplication/json
object
id
integer format: int64
createdAt
string format: date-time
updatedAt
string format: date-time
payload
nullable
result
nullable
status
string
Dozwolone wartości: New InProgress Completed Failed
command
string
nullable
scope
string
nullable
scopeValue
string
nullable
silentMode
boolean
ajsChainId
string
nullable
ajsChainVisits
string
nullable
Example
{
"status": "New"
}