Cancel a load
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Delete, RequestUri = new Uri("https://api.slflo.com/api/integration/v1/stock/loads/TJ-JNL-0812"), Headers = { { "Idempotency-Key", "example" }, { "Authorization", "Bearer <token>" }, },};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/stock/loads/TJ-JNL-0812")) .header("Idempotency-Key", "example") .header("Authorization", "Bearer <token>") .method("DELETE", HttpRequest.BodyPublishers.noBody()) .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/stock/loads/TJ-JNL-0812';const options = { method: 'DELETE', headers: {'Idempotency-Key': 'example', Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://api.slflo.com/api/integration/v1/stock/loads/TJ-JNL-0812 \ --header 'Authorization: Bearer <token>' \ --header 'Idempotency-Key: example'While it waits, its goods go back to where they came from; after a refusal nothing moves. result: cancelled, or unchanged when it was already cancelled. After the rep accepted: 409 LOAD_ALREADY_CHECKED. A ref that never had a load: 404 NOT_FOUND. Needs stock: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”Your key for the load — the transfer journal’s id in your ERP.
Example
TJ-JNL-0812Header Parameters
Section titled “Header Parameters”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.
Responses
Section titled “Responses”Cancel a load
object
object
Example
{ "data": { "entity": "van_load", "external_ref": "TJ-JNL-0812", "id": "op_01J9L", "kind": "LOAD", "number": "LD-000231", "replaced_id": null, "result": "cancelled", "state": "CANCELLED" }}default
Section titled “default”An error: the code says what, retryable whether to try again.
object
object
Stable code, e.g. SCOPE_MISSING, UNKNOWN_REFERENCE.
Field-level problems: {field, code}.
object
What happened and how to fix it.
Quote it to support; it finds the server log.
Whether the same call may succeed later.
Example
{ "error": { "code": "SCOPE_MISSING", "details": [], "message": "This client does not hold the invoices:read scope.", "request_id": "req_01J9X4Q7T2M8P3NRT6V5WZ", "retryable": false }}
