Saltar al contenido principal

Getting started

This guide takes you from zero to your first successful request against the Customer API.

1. Ask to have your access enabled​

Customer API access is enabled by the organization you work with, from their panel — you can't enable it yourself. If you don't have it yet, ask your contact there.

2. Generate your token from the portal​

  1. Log in to your portal (https://your-subdomain.web.midlaplatform.com, or whatever domain you were given) with your customer account.
  2. Go to My Profile.
  3. Open the API Access tab. If you don't see it, your access isn't enabled yet (step 1).
  4. Click Generate token.
  5. The token is shown only once, with a button to copy it. Copy it and store it somewhere safe — you won't be able to see it again.
Keep your token secure

Your Customer API token has no scopes — it permits all supported Customer operations, including receipt creation. Never share it or commit it to a public repository. If you suspect it leaked, generate a new one from the same tab — the old one is invalidated instantly (you can only have one active token at a time).

3. Make your first request​

Every Customer API endpoint lives under:

https://your-subdomain.web.midlaplatform.com/api/customer/v1/{resource}

For example, to list your own receipts:

curl https://your-subdomain.web.midlaplatform.com/api/customer/v1/receipts \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json"

If everything is set up correctly, the response is a 200 OK with JSON like this:

{
"data": [
{
"id": 231,
"name": "INCHN26091",
"status": "confirmed",
"warehouse": { "id": 148, "code": "WH000002", "name": "China", "...": "..." },
"customer": { "id": 61, "code": "BOX000001", "name": "...", "...": "..." },
"packages": [{ "id": 269, "content_description": "...", "...": "..." }],
"created_at": "2026-09-02T18:17:03+00:00"
}
],
"meta": { "current_page": 1, "per_page": 15, "total": 59, "last_page": 4 }
}

Notice that only your own receipts show up — never another customer's, no matter what filters you send.

Create a receipt​

Use POST /api/customer/v1/receipts with the same Bearer token and Content-Type: application/json. Obtain valid operation type, warehouse and package type IDs from the Customer catalogs first. The body must include type_id, warehouse_id and at least one entry in packages with package_type_id and pieces. Do not send customer_id or customer: the API assigns your account. Omit optional fields without a value; sending null for these validated optional fields returns 422. A successful creation returns 201. See Create receipt for all fields.

Next step​

Check out Authentication to understand why your token has no scopes, or jump straight to the endpoint reference.