Use the BillPro API to manage your products, customers, orders and payments from your own systems.
It's a JSON API over HTTPS. Almost every endpoint starts with /api/v2/profiles/{profile_id}, so each request works on one merchant profile.
flowchart TB Auth["Authenticate (API token)"] ProfileID["Find your profile_id in the dashboard address"] Customers["Customers create / list"] Products["Products create / price calculate"] Orders["Create order POST /orders"] Collect["Collect payment checkout · card · payment link"] Live["Live order"] Scheduled["Scheduled payments retry · skip · merge · execute"] Payments["Payments capture · refund · reverse"] Auth --> ProfileID ProfileID --> Customers ProfileID --> Products Customers --> Orders Products --> Orders Orders --> Collect --> Live Live --> Scheduled Live --> Payments
Before you start
You need two things:
- An API token. In the BillPro dashboard, open the profile menu, go to Users, select your integration user and copy the token from API Token. The section only appears when the user has API Access, which only Admin users can have. To turn it on, contact BillPro.
- Your profile ID. It's in the dashboard address, after
/profiles/. In/profiles/1234/orders, it's1234.
Keep your token secret and use it only from your server. See 1 · Authenticate.
Environments
| Environment | Base URL |
|---|---|
| Sandbox | https://test-api.bill.pro/api/v2 |
| Production | https://api.bill.pro/api/v2 |
Examples and Try It in these docs use the sandbox. Switch the host to production when you go live.
Make your first request
Send these headers with every request:
--header 'Authorization: Bearer {api_token}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json'For example, list your orders:
curl --request GET \
--url 'https://test-api.bill.pro/api/v2/profiles/{profile_id}/orders' \
--header 'Authorization: Bearer {api_token}' \
--header 'Accept: application/json'Response codes
| Status | Meaning |
|---|---|
200 OK | The request worked. |
201 Created | The record was created. |
204 No Content | The request worked. There's no response body. |
400 Bad Request | The request is malformed. For example, the body is missing its root key, such as order, or page is below 1. |
401 Unauthorized | The token is missing or invalid. |
403 Forbidden | You don't have access to this profile, or this action isn't allowed. |
404 Not Found | The record or profile doesn't exist, or the record belongs to another profile. |
409 Conflict | The record is in use, so it can't be deleted. |
422 Unprocessable Content | The request has invalid data. The response lists what's wrong. |
502 Bad Gateway | The payment gateway couldn't be reached, or failed partway. Check the record before you try again. |
Error responses include an error message.
Lists and pages
List endpoints return 20 records a page.
- Use
pageto move through the results. It starts at1. A page past the last one returns404, and0or a non-number returns400. - Use
itemsfor up to100records a page, on the lists that take it. A larger value gives100, and an invalid one gives20. - The response's
paginationobject gives the current page, the total pages and the total count.
Next steps
Follow the journey in the Overview, one stage at a time:
- Authenticate
- Build your catalog
- Create customers & orders
- Collect payment
- Recurring billing & recovery
To find any endpoint, use search (⌘K).