Utwórz zwrot na podstawie zamówienia
POST
/api/v3/returns/fromOrder
const url = 'https://twoja-instancja-smerp-api.enterprise.sellrocket.pl/api/v3/returns/fromOrder';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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}]}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Autoryzacja
Dział zatytułowany „Autoryzacja”Treść żądania
Dział zatytułowany „Treść żądania”Typ treściapplication/json
object
orderId
integer format: int64
orderLineItems
Array<object>
object
id
integer format: int64
quantity
integer format: int64
name
string
price
number format: double
returnsReasonId
integer format: int64
returnsPositionStatusId
integer format: int64
clientNote
string
returnParams
object
sourcePlatformReturnId
string
referenceNumber
string
externalPackage
boolean
buyerComment
string
useDeliveryCostsFromOrder
boolean
additionalField1
string
additionalField2
string
packStationId
integer format: int64
orderReturnAccountNumber
string
orderReturnIBan
string
orderReturnSwitft
string
sellerComments
Array<string>
fulfillmentStatus
integer format: int32
returnStatusId
integer format: int64
buyerEmail
string
buyerUsername
string
buyerPhone
string
recipientFirstName
string
recipientLastName
string
recipientCompanyName
string
recipientPhone
string
recipientApartmentNo
string
recipientHouseNo
string
recipientStreet
string
recipientCity
string
recipientPostCode
string
recipientState
string
recipientCountryCode
string
deliveryCostAmount
number format: double
summaryAmount
number format: double
additionalFields
Array<object>
object
fieldName
string
fieldType
string
fieldValue
string
additionalFieldDefinition
object
fieldName
string
fieldDisplayName
string
fieldType
string
predefinedValues
Array<string>
payments
Array<object>
object
platformId
string
platformName
string
finishedAtUtc
string format: date-time
currency
string
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 } ] }}Odpowiedzi
Dział zatytułowany „Odpowiedzi”Success
Typ treściapplication/json
object
id
integer format: int64
createdAt
string format: date-time
updatedAt
string format: date-time
payload
result
status
string
command
string
scope
string
scopeValue
string
silentMode
boolean
ajsChainId
string
ajsChainVisits
string
Example
{ "status": "New"}
