Push a price list header
PUT
/api/integration/v1/price-lists/{ref}
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Put, RequestUri = new Uri("https://api.slflo.com/api/integration/v1/price-lists/RETAIL"), Headers = { { "Idempotency-Key", "example" }, { "Authorization", "Bearer <token>" }, }, Content = new StringContent("{ \"currency\": \"EGP\", \"name\": { \"ar\": \"التجزئة\", \"en\": \"Retail\" }, \"source_version\": \"12\" }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.slflo.com/api/integration/v1/price-lists/RETAIL")) .header("Idempotency-Key", "example") .header("Authorization", "Bearer <token>") .header("Content-Type", "application/json") .method("PUT", HttpRequest.BodyPublishers.ofString("{ \"currency\": \"EGP\", \"name\": { \"ar\": \"التجزئة\", \"en\": \"Retail\" }, \"source_version\": \"12\" }")) .build();HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());const url = 'https://api.slflo.com/api/integration/v1/price-lists/RETAIL';const options = { method: 'PUT', headers: { 'Idempotency-Key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"currency":"EGP","name":{"ar":"التجزئة","en":"Retail"},"source_version":"12"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.slflo.com/api/integration/v1/price-lists/RETAIL \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: example' \ --data '{ "currency": "EGP", "name": { "ar": "التجزئة", "en": "Retail" }, "source_version": "12" }'Needs prices:write. Send an Idempotency-Key header; a retry with the same key and body answers the first answer again, with Idempotent-Replayed: true.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”ref
required
string
Your key for the price list.
Example
RETAILHeader Parameters
Section titled “Header Parameters”Idempotency-Key
required
string
Your key for this write, at most 100 characters (an order id or journal id works well). Required on every write; kept 7 days. Same key and body: the first answer again. Same key, other body: 422 IDEMPOTENCY_KEY_REUSED.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
currency
required
string
name
required
object
key
additional properties
string
source_version
string
Example
{ "currency": "EGP", "name": { "ar": "التجزئة", "en": "Retail" }, "source_version": "12"}Responses
Section titled “Responses”Push a price list header
Media typeapplication/json
object
data
required
object
entity
required
string
external_ref
required
string
id
required
string
result
required
string
Example
{ "data": { "entity": "price_list", "external_ref": "RETAIL", "id": "PL0000002", "result": "created" }}default
Section titled “default”An error: the code says what, retryable whether to try again.
Media typeapplication/json
object
error
required
object
code
required
Stable code, e.g. SCOPE_MISSING, UNKNOWN_REFERENCE.
string
details
required
Field-level problems: {field, code}.
Array<object>
object
key
additional properties
string
message
required
What happened and how to fix it.
string
request_id
required
Quote it to support; it finds the server log.
string
retryable
required
Whether the same call may succeed later.
boolean
Example
{ "error": { "code": "SCOPE_MISSING", "details": [], "message": "This client does not hold the invoices:read scope.", "request_id": "req_01J9X4Q7T2M8P3NRT6V5WZ", "retryable": false }}
