Utwórz lub zaktualizuj wiele zamówień
POST
/api/v5/Orders/batch-upsert
const url = 'https://twoja-instancja-smerp-api.enterprise.sellrocket.pl/api/v5/Orders/batch-upsert';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '[{"id":1,"clientReference":"example","source":{"connectionId":1,"platformAccountId":"example","platformOrderId":"example"},"allowDuplicates":true,"asteriskMarked":true,"asteriskKindId":1,"buyerComments":"example","sellerComments":"example","packState":1,"pickState":1,"buyer":{"email":"example","username":"example","fullName":"example","companyName":"example","rawCompanyTaxId":"example","phone":"example","address":{"apartmentNo":"example","houseNo":"example","street":"example","city":"example","postCode":"example","state":"example","countryCode":"example"}},"payments":{"paymentName":"example","payments":[{"platformId":"example","platformName":"example","finishedAtUtc":"2026-04-15T12:00:00Z","paymentAmount":{"currency":"example","amount":1},"paid":true}]},"status":{"id":1},"delivery":{"recipient":{"email":"example","username":"example","fullName":"example","companyName":"example","phone":"example","address":{"apartmentNo":"example","houseNo":"example","street":"example","city":"example","postCode":"example","state":"example","countryCode":"example"}},"pickupPoint":{"code":"example","name":"example","description":"example","address":{"apartmentNo":"example","houseNo":"example","street":"example","city":"example","postCode":"example","state":"example","countryCode":"example"}},"cost":{"currency":"example","amount":1},"method":{"platformId":"example","platformName":"example"},"isCod":true,"isPacked":true,"isPicked":true},"invoice":{"required":true,"payer":{"email":"example","username":"example","fullName":"example","companyName":"example","rawCompanyTaxId":"example","phone":"example","address":{"apartmentNo":"example","houseNo":"example","street":"example","city":"example","postCode":"example","state":"example","countryCode":"example"}}},"lineItems":[{"platformId":"example","product":{"id":1,"warehouseId":"example","platformId":"example","name":"example","code":"example","ean":"example","bundleId":"example","storage":"example","imageUrl":"example","parentName":"example","location":"example","variantId":"example","additionalEans":[{"ean":"example","quantity":1,"description":"example"}]},"quantity":1,"quantityPicked":1,"quantityPacked":1,"tax":{"symbol":"example","rate":1},"price":{"currency":"example","unitPrice":1},"originalCreatedAt":"2026-04-15T12:00:00Z","additionalFields":[{"fieldName":"example","fieldType":"example","fieldValue":"example","additionalFieldDefinition":{"fieldName":"example","fieldDisplayName":"example","fieldType":"example","predefinedValues":["example"]}}]}],"summary":{"totalToPay":{"currency":"example","amount":1}},"additionalField1":"example","additionalField2":"example","cancellation":{"cancelledAtUtc":"2026-04-15T12:00:00Z","reason":"example"},"fulfillmentByMarketplace":true,"platformDateAddedUtc":"2026-04-15T12:00:00Z","platformDateConfirmedUtc":"2026-04-15T12:00:00Z"}]'};
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/v5/Orders/batch-upsert \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '[ { "id": 1, "clientReference": "example", "source": { "connectionId": 1, "platformAccountId": "example", "platformOrderId": "example" }, "allowDuplicates": true, "asteriskMarked": true, "asteriskKindId": 1, "buyerComments": "example", "sellerComments": "example", "packState": 1, "pickState": 1, "buyer": { "email": "example", "username": "example", "fullName": "example", "companyName": "example", "rawCompanyTaxId": "example", "phone": "example", "address": { "apartmentNo": "example", "houseNo": "example", "street": "example", "city": "example", "postCode": "example", "state": "example", "countryCode": "example" } }, "payments": { "paymentName": "example", "payments": [ { "platformId": "example", "platformName": "example", "finishedAtUtc": "2026-04-15T12:00:00Z", "paymentAmount": { "currency": "example", "amount": 1 }, "paid": true } ] }, "status": { "id": 1 }, "delivery": { "recipient": { "email": "example", "username": "example", "fullName": "example", "companyName": "example", "phone": "example", "address": { "apartmentNo": "example", "houseNo": "example", "street": "example", "city": "example", "postCode": "example", "state": "example", "countryCode": "example" } }, "pickupPoint": { "code": "example", "name": "example", "description": "example", "address": { "apartmentNo": "example", "houseNo": "example", "street": "example", "city": "example", "postCode": "example", "state": "example", "countryCode": "example" } }, "cost": { "currency": "example", "amount": 1 }, "method": { "platformId": "example", "platformName": "example" }, "isCod": true, "isPacked": true, "isPicked": true }, "invoice": { "required": true, "payer": { "email": "example", "username": "example", "fullName": "example", "companyName": "example", "rawCompanyTaxId": "example", "phone": "example", "address": { "apartmentNo": "example", "houseNo": "example", "street": "example", "city": "example", "postCode": "example", "state": "example", "countryCode": "example" } } }, "lineItems": [ { "platformId": "example", "product": { "id": 1, "warehouseId": "example", "platformId": "example", "name": "example", "code": "example", "ean": "example", "bundleId": "example", "storage": "example", "imageUrl": "example", "parentName": "example", "location": "example", "variantId": "example", "additionalEans": [ { "ean": "example", "quantity": 1, "description": "example" } ] }, "quantity": 1, "quantityPicked": 1, "quantityPacked": 1, "tax": { "symbol": "example", "rate": 1 }, "price": { "currency": "example", "unitPrice": 1 }, "originalCreatedAt": "2026-04-15T12:00:00Z", "additionalFields": [ { "fieldName": "example", "fieldType": "example", "fieldValue": "example", "additionalFieldDefinition": { "fieldName": "example", "fieldDisplayName": "example", "fieldType": "example", "predefinedValues": [ "example" ] } } ] } ], "summary": { "totalToPay": { "currency": "example", "amount": 1 } }, "additionalField1": "example", "additionalField2": "example", "cancellation": { "cancelledAtUtc": "2026-04-15T12:00:00Z", "reason": "example" }, "fulfillmentByMarketplace": true, "platformDateAddedUtc": "2026-04-15T12:00:00Z", "platformDateConfirmedUtc": "2026-04-15T12:00:00Z" } ]'Upsert wielu zamówień wraz z pozycjami i płatnościami; pole ClientReference pozwala powiązać wyniki z wysłanymi rekordami. 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
Array<object>
object
id
integer format: int64
clientReference
string
source
object
connectionId
integer format: int64
platformAccountId
string
platformOrderId
string
allowDuplicates
boolean
asteriskMarked
boolean
asteriskKindId
integer format: int64
buyerComments
string
sellerComments
string
packState
integer format: int32
pickState
integer format: int32
buyer
object
email
string
username
string
fullName
string
companyName
string
rawCompanyTaxId
string
phone
string
address
object
apartmentNo
string
houseNo
string
street
string
city
string
postCode
string
state
string
countryCode
string
payments
object
paymentName
string
payments
Array<object>
object
platformId
string
platformName
string
finishedAtUtc
string format: date-time
paymentAmount
object
currency
string
amount
number format: double
paid
boolean
status
object
id
wymagane
integer format: int64
delivery
object
recipient
object
email
string
username
string
fullName
string
companyName
string
phone
string
address
object
apartmentNo
string
houseNo
string
street
string
city
string
postCode
string
state
string
countryCode
string
pickupPoint
object
code
string
name
string
description
string
address
object
apartmentNo
string
houseNo
string
street
string
city
string
postCode
string
state
string
countryCode
string
cost
object
currency
string
amount
number format: double
method
object
platformId
string
platformName
string
isCod
boolean
isPacked
boolean
isPicked
boolean
invoice
object
required
boolean
payer
object
email
string
username
string
fullName
string
companyName
string
rawCompanyTaxId
string
phone
string
address
object
apartmentNo
string
houseNo
string
street
string
city
string
postCode
string
state
string
countryCode
string
lineItems
Array<object>
object
platformId
string
product
object
id
integer format: int64
warehouseId
string
platformId
string
name
string
code
string
ean
string
bundleId
string
storage
string
imageUrl
string
parentName
string
location
string
variantId
string
additionalEans
Array<object>
object
ean
string
quantity
number format: double
description
string
quantity
wymagane
number format: double
quantityPicked
number format: double
quantityPacked
number format: double
tax
object
symbol
string
rate
number format: double
price
object
currency
string
unitPrice
Cena brutto
number format: double
originalCreatedAt
string format: date-time
additionalFields
Array<object>
object
fieldName
string
fieldType
string
fieldValue
string
additionalFieldDefinition
object
fieldName
string
fieldDisplayName
string
fieldType
string
predefinedValues
Array<string>
summary
object
totalToPay
object
currency
string
amount
wymagane
number format: double
additionalField1
string
additionalField2
string
cancellation
object
cancelledAtUtc
string format: date-time
reason
string
fulfillmentByMarketplace
boolean
platformDateAddedUtc
string format: date-time
platformDateConfirmedUtc
string format: date-time
Examplegenerated
[ { "id": 1, "clientReference": "example", "source": { "connectionId": 1, "platformAccountId": "example", "platformOrderId": "example" }, "allowDuplicates": true, "asteriskMarked": true, "asteriskKindId": 1, "buyerComments": "example", "sellerComments": "example", "packState": 1, "pickState": 1, "buyer": { "email": "example", "username": "example", "fullName": "example", "companyName": "example", "rawCompanyTaxId": "example", "phone": "example", "address": { "apartmentNo": "example", "houseNo": "example", "street": "example", "city": "example", "postCode": "example", "state": "example", "countryCode": "example" } }, "payments": { "paymentName": "example", "payments": [ { "platformId": "example", "platformName": "example", "finishedAtUtc": "2026-04-15T12:00:00Z", "paymentAmount": { "currency": "example", "amount": 1 }, "paid": true } ] }, "status": { "id": 1 }, "delivery": { "recipient": { "email": "example", "username": "example", "fullName": "example", "companyName": "example", "phone": "example", "address": { "apartmentNo": "example", "houseNo": "example", "street": "example", "city": "example", "postCode": "example", "state": "example", "countryCode": "example" } }, "pickupPoint": { "code": "example", "name": "example", "description": "example", "address": { "apartmentNo": "example", "houseNo": "example", "street": "example", "city": "example", "postCode": "example", "state": "example", "countryCode": "example" } }, "cost": { "currency": "example", "amount": 1 }, "method": { "platformId": "example", "platformName": "example" }, "isCod": true, "isPacked": true, "isPicked": true }, "invoice": { "required": true, "payer": { "email": "example", "username": "example", "fullName": "example", "companyName": "example", "rawCompanyTaxId": "example", "phone": "example", "address": { "apartmentNo": "example", "houseNo": "example", "street": "example", "city": "example", "postCode": "example", "state": "example", "countryCode": "example" } } }, "lineItems": [ { "platformId": "example", "product": { "id": 1, "warehouseId": "example", "platformId": "example", "name": "example", "code": "example", "ean": "example", "bundleId": "example", "storage": "example", "imageUrl": "example", "parentName": "example", "location": "example", "variantId": "example", "additionalEans": [ { "ean": "example", "quantity": 1, "description": "example" } ] }, "quantity": 1, "quantityPicked": 1, "quantityPacked": 1, "tax": { "symbol": "example", "rate": 1 }, "price": { "currency": "example", "unitPrice": 1 }, "originalCreatedAt": "2026-04-15T12:00:00Z", "additionalFields": [ { "fieldName": "example", "fieldType": "example", "fieldValue": "example", "additionalFieldDefinition": { "fieldName": "example", "fieldDisplayName": "example", "fieldType": "example", "predefinedValues": [ "example" ] } } ] } ], "summary": { "totalToPay": { "currency": "example", "amount": 1 } }, "additionalField1": "example", "additionalField2": "example", "cancellation": { "cancelledAtUtc": "2026-04-15T12:00:00Z", "reason": "example" }, "fulfillmentByMarketplace": true, "platformDateAddedUtc": "2026-04-15T12:00:00Z", "platformDateConfirmedUtc": "2026-04-15T12:00:00Z" }]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"}
