A payments API built for builders.
49 endpoints across purchases, payouts, billing, subscriptions and webhooks. Bearer-token auth, signed callbacks, fully documented schemas. Ship in a weekend.
- Endpoints
- 49
- Resources
- 11
- OpenAPI
- 3.0.0
curl -X POST "https://gate.safari.tech/api/v1/purchases/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client": { "email": "client@example.com" },
"purchase": {
"products": [{ "name": "Pro plan", "price": 4900 }],
"currency": "EUR"
},
"brand_id": "409eb80e-3782-4b1d-afa8-b779759266a5"
}'Create a Purchase, get a checkout_url, redirect your customer. That’s the whole flow.
JSON in, JSON out. Bearer-token auth, idempotent operations, asymmetric callback signing.
Up to 9 delivery attempts over 36 hours, sequential per object, signed with X-Signature.
Direct Post + Server-to-Server flows keep card data out of your stack.
Drop-in connectors for WooCommerce, Magento, OpenCart, PrestaShop and more.
Three things to know.
Read these once and the rest of the reference will feel familiar.
Authenticate with your API key
Pass your secret key as a Bearer token in the Authorization header of every request. Get one in your dashboard’s Developers section.
Use the same base URL everywhere
All endpoints below have a prefix of https://gate.safari.tech/api/v1/ — e.g. POST https://gate.safari.tech/api/v1/purchases/.
Subscribe to webhooks for state
Don’t poll. Register webhooks for events like purchase.paid and verify the X-Signature RSA header against your callback public key.
API ReferenceJump to resource
Purchases
10 endpoints
/purchases/Create a purchase – the main request for any e-commerce integration.
To run payments in your application use `POST /purchases/`, request to register payments and receive the checkout link (`checkout_url`). After the payment is processed, gateway will redirect the client back to your website (take note of `success_redirect`, `failure_redirect`). You have three options to check payment status: 1) use `success_callback` parameter of `Purchase` object; 2) use `GET /purchases/<purchase_id>/` request; 3) set up a Webhook using the UI or Webhook API to listen to `purchase.paid` or `purchase.payment_failure` event on your server. Using `skip_capture` flag allows you…
Request body
Either this or `.client_id` is required.
Show child attributes
Email address
Phone number in the `<country_code> <number>` format
Name and surname of client
Personal identification code of client
Street house number and flat address where applicable
Country code in the ISO 3166-1 alpha-2 format (e.g. 'GB')
City name
ZIP or postal code
State code
Street house number and flat address where applicable
Country code in the ISO 3166-1 alpha-2 format (e.g. 'GB')
City name
ZIP or postal code
State code
Email addresses to receive a carbon copy of all notification emails
Email addresses to receive a blind carbon copy of all notification emails
Legal name of company
Company brand name
Registration number of company
Tax payer registration number
List of delivery methods for invoices
Show child attributes
The method of invoice delivery
emailtext_messageAdditional options for the delivery method
Core information about the Purchase, including the products, total, currency and invoice fields. If you're using invoicing via `/billing/` or `/billing_templates/`, this object will be copied 1:1 from BillingTemplate you specify to the resulting Purchases (also to subscription Purchases).
Show child attributes
Currency code in the ISO 4217 standard (e.g. 'EUR'). Default currency is `EUR`.
Line items of the invoice. In case of a transaction with no invoice sent, specify a single Product forming the cost of transaction.
Show child attributes
Product name
Quantity of these products in invoice
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY. You can use this field or `total_override` with a value of 0 to activate preauthorization scenario. See the description of the `Purchase.skip_capture` field.
Total discount per this product in invoice
Percent of tax added to the price of this product
Product category
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Language code in the ISO 639-1 format (e.g. 'en'). Supported values: `az`, `de`, `en`, `en-GB`, `es`, `et`, `fr`, `it`, `lt`, `lv`, `pt`, `pt-BR`, `ru`, `tr`, `uk`.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
ClientDetails fields to request from the client before the payment. If a value is passed for a field in ClientDetails, it will be automatically removed from this list.
Timezone to localize invoice-specific timestamps in, e.g. to display a concrete date for a `due` timestamp on the invoice.
Whether to permit payments when Purchase's `due` has passed. By default those are permitted (and status will be set to `overdue` once `due` moment is passed). If this is set to `true`, it won't be possible to pay for an overdue invoice, and when `due` is passed the Purchase's status will be set to `expired`.
An optional message to display to your customer in invoice email, e.g. "Your invoice for June".
Custom information with maximum length of 10000 characters
When set to true, prevents retry attempts if the payment fails. The purchase will be immediately marked as cancelled upon failure, and the payer will not see a retry button on the failure page. If not provided, inherits the value from the Company's `single_attempt` setting.
Details of an executed transaction. Read-only for `Purchase`s and `Payout`s. For an unpaid `Purchase`, this object will be `null`.
Show child attributes
Denotes the direction of payment, e.g. for a paid Purchase, is granted to be `false`, `true` for payouts.
purchasepurchase_chargepayoutbank_paymentrefundcustomAmount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Currency code in the ISO 4217 standard (e.g. 'EUR'). Default currency is `EUR`.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
When the payment was accepted in (`is_outgoing == false`) or sent from (`is_outgoing == true`) the gateway system.
If available, this field will report the date the payment was sent by the remote payer (`is_outgoing == false`) or when funds arrived to the remote beneficiary (`is_outgoing == true`).
Read-only details of issuer company/brand, persisted for invoice display.
Show child attributes
Company website URL
Street house number and flat address where applicable
Country code in the ISO 3166-1 alpha-2 format (e.g. 'GB')
City name
ZIP or postal code
Show child attributes
Bank account number (e.g. IBAN)
SWIFT/BIC code of the bank
Legal name of company
Company brand name
Registration number of company
Tax payer registration number
Payment method-specific, read-only transaction data. Will contain information about all the transaction attempts and possible errors, if available.
Show child attributes
Payment method used if Purchase was paid, blank string otherwise.
Extra data associated with selected payment method if Purchase was paid, empty object otherwise. Dataset depends on payment method. E.g. for card payment methods like `visa` or `mastercard` it will contain properties `masked_pan: string`, `three_d_secure: boolean`, `expiry_month: int`, `expiry_year: int` and `cardholder_name: string`.
Country code (in the ISO 3166-1 alpha-2 format e.g. 'GB') where payment tool used originates (e.g. in case of card payments, the card issuing country). Will be blank if Purchase was not paid or country could not be detected.
Will contain information about all the payment attempts made and errors encountered, if any.
Show child attributes
Type of action attempted
executeauthorizereleasecapturerecurring_executedelete_recurring_tokenrefundIf this attempt was successful or not. For `false`, `error` of this attempt will be not null.
Payment method used for this attempt.
Extra data associated with selected payment method. Dataset depends on payment method. E.g. for card payment methods like `visa` or `mastercard` it will contain properties `masked_pan: string`, `three_d_secure: boolean`, `expiry_month: int`, `expiry_year: int` and `cardholder_name: string`.
Country code (in the ISO 3166-1 alpha-2 format e.g. 'GB') where payment tool used originates (e.g. in case of card payments, the card issuing country). Will be blank if country could not be detected.
IP the paying client made this attempt from, if available.
Time (if possible, fetched from the remot processing system) this attempt happened at.
Code and description of the error encountered. Not-null if `successful` parameter of this attempt is `false`.
Purchase status. Can have the following values: `created`: Purchase was created using POST /purchases/ or Billing API capabilities. --- `sent`: Invoice for this purchase was sent over email using Billing API capabilities. --- `viewed`: The client has viewed the payform and/or invoice details for this purchase. --- `error`: There was a failed payment…
createdsentviewederrorcancelledoverdueexpiredholdreleasedpending_releasepending_capturepreauthorized+6 moreHistory of status changes, latest last. Might contain entry about a related object, e.g. status change to `refunded` will contain a reference to the refund Payment.
Show child attributes
Purchase status. Can have the following values: `created`: Purchase was created using POST /purchases/ or Billing API capabilities. --- `sent`: Invoice for this purchase was sent over email using Billing API capabilities. --- `viewed`: The client has viewed the payform and/or invoice details for this purchase. --- `error`: There was a failed payment…
createdsentviewederrorcancelledoverdueexpiredholdreleasedpending_releasepending_capturepreauthorized+6 moreShow child attributes
Time the payment form or invoice page was first viewed on
Indicates this is a test object, created using test API keys or using Billing section of UI while in test mode.
ID of user who has created this object in the Billing UI, if applicable.
ID of the brand to create this Purchase for. You can copy it down in the API section, see the "specify the ID of the Brand" link in answer to "How to setup payments on website or in mobile app?".
ID of a BillingTemplate that has spawned this Purchase, if any.
ID of a Client object used to initialize ClientDetails (`.client`) of this Purchase. Either this field or specifying `.client` object is required (you can only specify a value for one of these fields). All `ClientDetails` fields from the Client will be copied to `.client` object. Note that editing Client object won't change the respective fields in already c…
Whether to send receipt email for this Purchase when it's paid.
Indicates whether a recurring token (e.g. for card payments - card token) was saved for this Purchase. If this is `true`, the `id` of this Purchase can be used as a `recurring_token` in `POST /purchases/{id}/charge/`, enabling you to pay for that Purchase using the same method (same card for card payments) that this one was paid with.
ID of a recurring token (Purchase having `is_recurring_token == true`) that was used to pay this Purchase, if any.
Card payment-specific: if set to true, only authorize the payment (place funds on hold) when payer enters his card data and pays. This option requires a `POST /capture/` or `POST /release/` later on. You can use the preauthorization feature if you set this parameter to true and make the Purchase with `purchase.total == 0` (this can be achieved by providing…
If the used payment method supports recurring payment functionality, forces the customer's payment credentials to be saved for possible later recurring payments, without giving the customer a choice in the matter.
If you don't provide an invoice `reference` yourself, this autogenerated value will be used as a reference instead.
Invoice reference.
Value for 'Invoice issued' field. Display-only, does not get validated. If not provided, will be generated as the current date in `purchase.timezone` at the moment of Purchase's creation.
When the payment is due for this Purchase. The default behaviour is to still allow payment once this moment passes. To change that, set `purchase.due_strict` to true.
Specifies, if the purchase can be refunded fully and partially, only fully, partially or not at all.
allfull_onlypartial_onlypis_allpis_partialnoneAmount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
This object is present when automatic currency conversion has occurred upon creation of the purchase. Purchase's original currency was changed and its original amount was converted using the exchange rate shown here.
Show child attributes
Currency this purchase was initially created with
Amount this purchase was initially created with
Exchanged rate that was used for currency conversion. Original amount was multiplied by this number to calculate the new purchase amount.
An optional whitelist of payment methods availble for this purchase. Use this field if you want to restrict your payer to pay using only one or several specific methods. Using this field and at the same time trying to use specific capabilities of a Purchase (e.g. `skip_capture` or charging it using a saved card token using `POST /purchases/{id}/charge/`) c…
When Purchase is paid for successfully, your customer will be taken to this link. Otherwise a standard screen will be displayed.
If there's a payment failure for this Purchase, your customer will be taken to this link. Otherwise a standard screen will be displayed.
If you provide this link, customer will have an option to go to it instead of making payment (a button with 'Return to seller' text will be displayed). Can't contain any of the following symbols: `<>'"` . Be aware that this does not cancel the payment (e.g. does not do the equivalent of doing the `POST /purchases/{id}/cancel/` request); the client will stil…
When Purchase is paid for successfully, the `success_callback` URL will receive a POST request with the Purchase object's data in body.
Identification of software (e.g. an ecommerce module and version) used to create this purchase, if any.
Platform this Purchase was created on.
webapiiosandroidmacoswindowsDefines which gateway product was used to create this Purchase.
purchasesbilling_invoicesbilling_subscriptionsbilling_subscriptions_invoiceIP the Purchase was created from.
URL you will be able to access invoice for this Purchase at, if applicable
URL you will be able to access the checkout for this Purchase at, if payment for it is possible. When building integrations, redirect the customer to this URL once purchase is created. You can add the `preferred` query arg to the `checkout_url` in order to force redirect the client straight to the checkout for a specific payment method (`?preferred={paymen…
URL that can be used for Direct Post integration. This functionality is activated for each merchant account individually. Please consult with your account manager if you wish to use it. Will be null if payment for purchase is not possible, `purchase.request_client_details` isn't empty or success_redirect/failure_redirect are not provided - these all brea…
True if a purchase was manually marked as paid.
ID of corresponding order.
Array of IDs of related Upsell campaigns.
ID of Referral campaign.
Referral code used with purchase.
Referral code created by purchase.
Referral code detailed information for purchase.
Show child attributes
Referral campaign ID.
Reward type of applied Referral code.
giftdiscountmoneyAmount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Discount percent of applied Referral code
Retain level detailed information for purchase.
Show child attributes
Retain campaign ID.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Discount percent of applied Retain level.
Object type identifier
Object creation time
Object last modification time
Response · 201
OK
curl -X POST "https://gate.safari.tech/api/v1/purchases/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client": {
"email": "test@test.com"
},
"purchase": {
"products": [
{
"name": "test",
"price": 100
}
]
},
"brand_id": "409eb80e-3782-4b1d-afa8-b779759266a5"
}'{}/purchases/{id}/Retrieve an object by ID.
Path parameters
Object ID (UUID)
Response · 200
OK
curl -X GET "https://gate.safari.tech/api/v1/purchases/{id}/" \
-H "Authorization: Bearer YOUR_API_KEY"{}/purchases/{id}/cancel/Cancel a pending purchase.
If you have a Purchase that payment is possible for, using this request you can guarantee that it won't be paid.
Path parameters
Object ID (UUID)
Response · 200
OK
curl -X POST "https://gate.safari.tech/api/v1/purchases/{id}/cancel/" \
-H "Authorization: Bearer YOUR_API_KEY"{}/purchases/{id}/release/Release funds on hold.
Release funds reserved for a Purchase (`status == hold`). You can place a `hold` (authenticate the payment) using `skip_capture == true` when creating the Purchase and ensuring your client submits the payment form. If this operation takes too long to be processed on the acquirer side - you will get a response with status code 200 and a Purchase object having `status` = `pending_release` in body (you will receive a corresponding Webhook callback too for a `purchase.pending_release` event). To be notified of a successful operation completion, please subscribe to `purchase.released` callback eve…
Path parameters
Object ID (UUID)
Response · 200
OK
curl -X POST "https://gate.safari.tech/api/v1/purchases/{id}/release/" \
-H "Authorization: Bearer YOUR_API_KEY"{}/purchases/{id}/capture/Capture a previously authorized payment.
Capture funds reserved for a Purchase (`status == hold`). You can place a `hold` (authenticate the payment) using `skip_capture == true` when creating the Purchase and ensuring your client submits the payment form. If this operation takes too long to be processed on the acquirer side - you will get a response with status code 200 and a Purchase object having `status` = `pending_capture` in body (you will receive a corresponding Webhook callback too for a `purchase.pending_capture` event). To be notified of a successful operation completion, please subscribe to `purchase.captured` callback eve…
Path parameters
Object ID (UUID)
Request body
Amount to be captured. Used to perform partial captures. Remainder will be automatically released.
Response · 200
OK
curl -X POST "https://gate.safari.tech/api/v1/purchases/{id}/capture/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 0
}'{}/purchases/{id}/charge/Charge or Hold a purchase using a saved token.
Charge or Hold a purchase using a `recurring_token` provided in the request body. Its value should be an `id` of a Purchase that has `is_recurring_token == true`. This purchase will be paid using the same method (e.g. same card) as the one used to pay the `recurring_token` purchase. The Hold will be performed if the Purchase this method is used on has `skip_capture`: `true`. If this operation takes too long to be processed on the acquirer side - you will get a response with status code 200 and a Purchase object having `status` = `pending_charge` in body (you will receive a corresponding Webho…
Path parameters
Object ID (UUID)
Request body
ID of a recurring token (Purchase having `is_recurring_token == true`) to use.
Response · 200
OK
curl -X POST "https://gate.safari.tech/api/v1/purchases/{id}/charge/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recurring_token": "ea582899-78ec-4c3a-9cb3-08f922e556b6"
}'{}/purchases/{id}/delete_recurring_token/Delete a recurring token associated with a purchase.
Will set `is_recurring_token` to `false`. You won't be able to use this Purchase's ID as a `recurring_token` anymore. The respective ClientRecurringToken, if any, will also be deleted. If this operation takes too long to be processed on the acquirer side - you will get a response with status code 200 a corresponding Webhook callback for a `purchase.pending_recurring_token_delete` event. To be notified of a successful operation completion, please subscribe to `purchase.recurring_token_deleted` callback event.
Path parameters
Object ID (UUID)
Response · 200
OK
curl -X POST "https://gate.safari.tech/api/v1/purchases/{id}/delete_recurring_token/" \
-H "Authorization: Bearer YOUR_API_KEY"{}/purchases/{id}/refund/Refund a paid purchase.
Will generate a Payment object and return it as a successful response. Optional `amount` argument can be included in the request body to request a partial refund. Consult `refund_availability` field on Purchase on details whether this Purchase can be refunded or not. If this operation takes too long to be processed on the acquirer side - you will get a response with status code 200 and a Purchase object having `status` = `pending_refund` in body (you will receive a corresponding Webhook callback too for a `purchase.pending_refund` event). To be notified of a successful operation completion…
Path parameters
Object ID (UUID)
Request body
Amount to refund in minor units of the purchase's currency - e.g. `100` for €1.00. Should not be more than `Purchase.refundable_amount`. Optional; if not provided, a full refund will be executed. See the description for `Purchase.refund_availability` field.
Optional custom reference for the refund.
Response · 200
OK
curl -X POST "https://gate.safari.tech/api/v1/purchases/{id}/refund/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 120,
"reference": "REFUND-123"
}'{}/purchases/{id}/mark_as_paid/Mark a purchase as paid.
Will set the purchase's status to `paid`. `purchase.marked_as_paid` field will also be set to true to distinguish this purchase.
Path parameters
Object ID (UUID)
Request body
UTC timestamp at which this purchase was paid. Current time will be used if omitted.
Response · 200
OK
curl -X POST "https://gate.safari.tech/api/v1/purchases/{id}/mark_as_paid/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"paid_on": 1635162311
}'{}/purchases/{id}/resend_invoice/Re-sends invoice
Will re-send the invoice.
Path parameters
Object ID (UUID)
Response · 200
OK
curl -X POST "https://gate.safari.tech/api/v1/purchases/{id}/resend_invoice/" \
-H "Authorization: Bearer YOUR_API_KEY"{}Payouts
2 endpoints
/payouts/Create an unprocessed payout object. A separate request is needed to execute the payout.
To issue payouts in your application use `POST /payouts/` request to register a payout. Response will contain the payout execution url - `execution_url`. For card payouts send a POST request to `execution_url` with a JSON payload containing recipient's card details: `expiry_month`: string; 1-2 digits `expiry_year`: string; 1-2 digits, `card_number`: string; 16-19 chars, `cardholder_name`: string; 1-30 chars. <br><br>For wallet payouts, please contact support to get specific details on how to send a POST request to execution_url.<br><br> You need to do the 2nd request within 15 minutes…
Request body
Details of an executed transaction. Read-only for `Purchase`s and `Payout`s. For an unpaid `Purchase`, this object will be `null`.
Show child attributes
Denotes the direction of payment, e.g. for a paid Purchase, is granted to be `false`, `true` for payouts.
purchasepurchase_chargepayoutbank_paymentrefundcustomAmount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Currency code in the ISO 4217 standard (e.g. 'EUR'). Default currency is `EUR`.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
When the payment was accepted in (`is_outgoing == false`) or sent from (`is_outgoing == true`) the gateway system.
If available, this field will report the date the payment was sent by the remote payer (`is_outgoing == false`) or when funds arrived to the remote beneficiary (`is_outgoing == true`).
Contains details about the client of a purchase or payment - the remote payer/fund recipient party.
Show child attributes
Email address
Phone number in the `<country_code> <number>` format
Name and surname of client
Personal identification code of client
Street house number and flat address where applicable
Country code in the ISO 3166-1 alpha-2 format (e.g. 'GB')
City name
ZIP or postal code
State code
Street house number and flat address where applicable
Country code in the ISO 3166-1 alpha-2 format (e.g. 'GB')
City name
ZIP or postal code
State code
Email addresses to receive a carbon copy of all notification emails
Email addresses to receive a blind carbon copy of all notification emails
Legal name of company
Company brand name
Registration number of company
Tax payer registration number
List of delivery methods for invoices
Show child attributes
The method of invoice delivery
emailtext_messageAdditional options for the delivery method
Payment method-specific, read-only transaction data. Will contain information about all the transaction attempts and possible errors, if available.
Show child attributes
Payment method used if Payout was paid, blank string otherwise.
Extra data associated with selected payment method if Payout was paid, empty object otherwise. Dataset depends on payment method. E.g. for card payment methods like `visa` or `mastercard` it will contain properties `masked_pan: string`, `three_d_secure: boolean`, `expiry_month: int`, `expiry_year: int` and `cardholder_name: string`.
Country code (in the ISO 3166-1 alpha-2 format e.g. 'GB') where payment tool used originates (e.g. in case of card payments, the card issuing country). Will be blank if Payout was not paid or country could not be detected.
Will contain information about all the payment attempts made and errors encountered, if any.
Show child attributes
If this attempt was successful or not. For `false`, `error` of this attempt will be not null.
Payment method used for this attempt.
Extra data associated with selected payment method. Dataset depends on payment method. E.g. for card payment methods like `visa` or `mastercard` it will contain properties `masked_pan: string`, `three_d_secure: boolean`, `expiry_month: int`, `expiry_year: int` and `cardholder_name: string`.
Country code (in the ISO 3166-1 alpha-2 format e.g. 'GB') where payment tool used originates (e.g. in case of card payments, the card issuing country). Will be blank if country could not be detected.
IP the paying client made this attempt from, if available.
Time (if possible, fetched from the remot processing system) this attempt happened at.
Code and description of the error encountered. Not-null if `successful` parameter of this attempt is `false`.
If you don't provide an invoice `reference` yourself, this autogenerated value will be used as a reference instead.
Payout reference.
`Payout` status. Can have the following values: `initialized`: `Payout` was created, but not executed. Initial status to new `Payout`s. --- `pending`: `Payout`'s execution is currently pending --- `error`: An error has occurred during the execution. Execution can be attempted again. --- `success`: `Payout` was executed successfully.
initializedpendingerrorsuccessHistory of status changes, latest last.
Show child attributes
`Payout` status. Can have the following values: `initialized`: `Payout` was created, but not executed. Initial status to new `Payout`s. --- `pending`: `Payout`'s execution is currently pending --- `error`: An error has occurred during the execution. Execution can be attempted again. --- `success`: `Payout` was executed successfully.
initializedpendingerrorsuccessName of payout sender.
Recipient's card's registration country. Country code in the ISO 3166-1 alpha-2 format (e.g. `GB`).
Recipient's card's brand, e.g. `visa` or `mastercard`.
An optional whitelist of payment methods availble for this Payout. Use this field if you want to restrict your payer to pay using only one or several specific methods.
URL that must be used for payout execution. See details in description.
ID of the brand to create this Payout for. You can copy it down in the API section, see the "specify the ID of the Brand" link in answer to "How to setup payments on website or in mobile app?".
Show child attributes
Legal name of company
Company brand name
Indicates this is a test object, created using test API keys or using Billing section of UI while in test mode.
ID of user who has created this object in the Billing UI, if applicable.
Object type identifier
Object creation time
Object last modification time
Response · 201
OK
curl -X POST "https://gate.safari.tech/api/v1/payouts/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client": {
"email": "test@example.com"
},
"payment": {
"amount": 10000,
"currency": "EUR",
"description": "This is a description"
},
"brand_id": "f025d78f-3d23-49d1-a377-e2bf7e318a25"
}'{}/payouts/{id}/Retrieve an object by ID.
Path parameters
Object ID (UUID)
Response · 200
OK
curl -X GET "https://gate.safari.tech/api/v1/payouts/{id}/" \
-H "Authorization: Bearer YOUR_API_KEY"{}Billing
11 endpoints
/billing/Send an invoice to one or several clients.
Use this endpoint to send a one time invoice(-s). Provide all data of a `BillingTemplate` (see Schemas below) and, additionally, an array of one or more BillingTemplateClients in `clients`. Purchases will be created and invoices sent, one for every Client you have specified. A BillingTemplate won't be created; if you need to be able to issue repeated, similar invoices, see `POST /billing_templates/` and `POST /billing_templates/{id}/send_invoice/`. Note that unlike for other requests where you can send BillingTemplate data (like `POST /billing_templates/`), `title` and `is_subscription` ar…
Request body
Show child attributes
ID of the Client object to add to the BillingTemplate. Read-only after the BillingTemplateClient has been created. Note that the same Client can be added to a BillingTemplate several times.
Only used together with number_of_billing_cycles on BillingTemplate. Shows number of billing cycles passed when number of cycles is limited
When present overrides reference for invoices generated for this client
For subscriptions, you can edit (`PATCH /billing_templates/{id}/clients/{id}/`) this status between `active` and `subscription_paused` values to pause the client's subscription. Paused subscriptions run as normal, except for purchases not being created and invoices sent for them. It means that if you pause a BillingTemplateClient's monthly subscription cycle…
pendinginactiveactivesubscription_pausedIf not null, reports the date when the next billing is scheduled for this client.
An optional whitelist of payment methods availble for purchases generated for this BillingTemplateClient. Copied 1:1 to `Purchase.payment_method_whitelist` field on created Purchases (see its description).
Sends invoice when subscription charge fails if this is `true`
Sends invoice when `POST /billing_templates/{id}/add_subscriber/` is called if this is `true`
Sends receipt when subscription charge succeeds if this is `true`
Object type identifier
Object creation time
Object last modification time
Core information about the Purchase, including the products, total, currency and invoice fields. If you're using invoicing via `/billing/` or `/billing_templates/`, this object will be copied 1:1 from BillingTemplate you specify to the resulting Purchases (also to subscription Purchases).
Show child attributes
Currency code in the ISO 4217 standard (e.g. 'EUR'). Default currency is `EUR`.
Line items of the invoice. In case of a transaction with no invoice sent, specify a single Product forming the cost of transaction.
Show child attributes
Product name
Quantity of these products in invoice
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY. You can use this field or `total_override` with a value of 0 to activate preauthorization scenario. See the description of the `Purchase.skip_capture` field.
Total discount per this product in invoice
Percent of tax added to the price of this product
Product category
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Language code in the ISO 639-1 format (e.g. 'en'). Supported values: `az`, `de`, `en`, `en-GB`, `es`, `et`, `fr`, `it`, `lt`, `lv`, `pt`, `pt-BR`, `ru`, `tr`, `uk`.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
ClientDetails fields to request from the client before the payment. If a value is passed for a field in ClientDetails, it will be automatically removed from this list.
Timezone to localize invoice-specific timestamps in, e.g. to display a concrete date for a `due` timestamp on the invoice.
Whether to permit payments when Purchase's `due` has passed. By default those are permitted (and status will be set to `overdue` once `due` moment is passed). If this is set to `true`, it won't be possible to pay for an overdue invoice, and when `due` is passed the Purchase's status will be set to `expired`.
An optional message to display to your customer in invoice email, e.g. "Your invoice for June".
Custom information with maximum length of 10000 characters
When set to true, prevents retry attempts if the payment fails. The purchase will be immediately marked as cancelled upon failure, and the payer will not see a retry button on the failure page. If not provided, inherits the value from the Company's `single_attempt` setting.
Limits number of billing cycles for each client if set to a non-zero value
Indicates this is a test object, created using test API keys or using Billing section of UI while in test mode.
ID of user who has created this object in the Billing UI, if applicable.
ID of the brand to create this BillingTemplate for. You can copy it down in the API section, see the "specify the ID of the Brand" link in answer to "How to setup payments on website or in mobile app?".
Defines whether this BillingTemplate issues invoices in a recurring manner - it's a subscription - or it sends invoices only once. You can't change this parameter when you edit the BillingTemplate. If this field is `true`, you will need to specify `subscription_*` fields and `invoice_*` fields are read-only, and vice-versa.
Sets `issued` on the Purchase objects generated. Generated from current day in `purchase.timezone` if not provided. Read-only if `is_subscription == true`.
Sets `due` on the Purchase objects generated. Required if `is_subscription == false`, read-only otherwise.
Sets `skip_capture` on the Purchase objects generated. `false` by default. Read-only if `is_subscription == true`.
Sets `send_receipt` on the Purchase objects generated. `true` by default (unlike in Purchases API, where by default receipts are not sent). Read-only if `is_subscription == true`.
Defines how often are the subscription Purchases generated. Used together with `subscription_period_units`: to issue Purchases once a month, use `"...period": 1` and `"...period_units" == "months"`. Variable number of days in a month is respected; e.g. if subscription has a period of 1 month, a client had its billing cycle activated on January 30 and there…
See `subscription_period`.
Used to generate `due` on the Purchase objects generated. Used together with `subscription_due_period_units`: to set the final `Purchase.due` to a week after it's generated/invoice is sent, use `"...period": 1` and `"...period_units" == "weeks". Required if `is_subscription == true`, read-only otherwise.
See `subscription_due_period`.
If this is `true`, clients are charged at the end of billing periods, and vice-versa. E.g. if you add a subscriber client to a BillingTemplate, with this value being set to `false`, he will receive first invoice today, otherwise - after a single billing period (defined by `subscription_period`/`subscription_period_units`) passes. Required when creating a B…
How many trial periods to give the client prior to starting his billing cycle. If billing period is 1 month and you set this value to 2, subscription will automatically adjust to giving your client 2 months without payments and then charging him for the 3rd month (when exactly depends on `subscription_charge_period_end`: 3 months after the subscriber was lau…
Whether this subscription is paused. Has the same effect as setting `"status": "subscription_paused"` for every BillingTemplateClient launched for this subscription, see the description of `status` on BillingTemplateClient for more details. Ignored (read-only) if `is_subscription == false`.
If this is `true`, there were launched clients (`POST /billing_templates/{id}/add_subscriber/` - or subscribers that were added via the gateway system UI) for this subscription. While this is `false` (it will be as long as you're only just created the template and haven't launched any subscribers), you can edit all of `subscription_*` fields. If this is `…
If the used payment method supports recurring payment functionality, forces the customer's payment credentials to be saved for possible later recurring payments, without giving the customer a choice in the matter.
Array of IDs of related Upsell campaigns.
ID of Referral campaign.
Response · 200
OK
curl -X POST "https://gate.safari.tech/api/v1/billing/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"clients": [
{}
]
}'[
"720e2c96-ef94-4baa-90b6-d61ef6fd675a"
]/billing_templates/List all billing templates.
Response · 200
OK
curl -X GET "https://gate.safari.tech/api/v1/billing_templates/" \
-H "Authorization: Bearer YOUR_API_KEY"{
"results": [
{}
],
"next": "string",
"previous": "string"
}/billing_templates/Create a template to issue repeated invoices from in the future, with or without a subscription.
BillingTemplate generates Purchase objects, either to issue one-time invoices or in a subscription. It does so by copying over its' `PurchaseDetails`, one of its `BillingTemplateClient`-s and generating other fields from BillingTemplate's fields as necessary into a new `Purchase` object. If `is_subscription` is `true`, it is considered to be a subscription's BillingTemplate. You will need to specify `subscription_*` fields like `subscription_period` when creating it and add BillingTemplateClient objects to its billing cycle (`POST /billing_templates/{id}/add_subscriber/`). After that the cli…
Request body
Core information about the Purchase, including the products, total, currency and invoice fields. If you're using invoicing via `/billing/` or `/billing_templates/`, this object will be copied 1:1 from BillingTemplate you specify to the resulting Purchases (also to subscription Purchases).
Show child attributes
Currency code in the ISO 4217 standard (e.g. 'EUR'). Default currency is `EUR`.
Line items of the invoice. In case of a transaction with no invoice sent, specify a single Product forming the cost of transaction.
Show child attributes
Product name
Quantity of these products in invoice
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY. You can use this field or `total_override` with a value of 0 to activate preauthorization scenario. See the description of the `Purchase.skip_capture` field.
Total discount per this product in invoice
Percent of tax added to the price of this product
Product category
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Language code in the ISO 639-1 format (e.g. 'en'). Supported values: `az`, `de`, `en`, `en-GB`, `es`, `et`, `fr`, `it`, `lt`, `lv`, `pt`, `pt-BR`, `ru`, `tr`, `uk`.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
ClientDetails fields to request from the client before the payment. If a value is passed for a field in ClientDetails, it will be automatically removed from this list.
Timezone to localize invoice-specific timestamps in, e.g. to display a concrete date for a `due` timestamp on the invoice.
Whether to permit payments when Purchase's `due` has passed. By default those are permitted (and status will be set to `overdue` once `due` moment is passed). If this is set to `true`, it won't be possible to pay for an overdue invoice, and when `due` is passed the Purchase's status will be set to `expired`.
An optional message to display to your customer in invoice email, e.g. "Your invoice for June".
Custom information with maximum length of 10000 characters
When set to true, prevents retry attempts if the payment fails. The purchase will be immediately marked as cancelled upon failure, and the payer will not see a retry button on the failure page. If not provided, inherits the value from the Company's `single_attempt` setting.
Limits number of billing cycles for each client if set to a non-zero value
Indicates this is a test object, created using test API keys or using Billing section of UI while in test mode.
ID of user who has created this object in the Billing UI, if applicable.
ID of the brand to create this BillingTemplate for. You can copy it down in the API section, see the "specify the ID of the Brand" link in answer to "How to setup payments on website or in mobile app?".
Defines whether this BillingTemplate issues invoices in a recurring manner - it's a subscription - or it sends invoices only once. You can't change this parameter when you edit the BillingTemplate. If this field is `true`, you will need to specify `subscription_*` fields and `invoice_*` fields are read-only, and vice-versa.
Sets `issued` on the Purchase objects generated. Generated from current day in `purchase.timezone` if not provided. Read-only if `is_subscription == true`.
Sets `due` on the Purchase objects generated. Required if `is_subscription == false`, read-only otherwise.
Sets `skip_capture` on the Purchase objects generated. `false` by default. Read-only if `is_subscription == true`.
Sets `send_receipt` on the Purchase objects generated. `true` by default (unlike in Purchases API, where by default receipts are not sent). Read-only if `is_subscription == true`.
Defines how often are the subscription Purchases generated. Used together with `subscription_period_units`: to issue Purchases once a month, use `"...period": 1` and `"...period_units" == "months"`. Variable number of days in a month is respected; e.g. if subscription has a period of 1 month, a client had its billing cycle activated on January 30 and there…
See `subscription_period`.
Used to generate `due` on the Purchase objects generated. Used together with `subscription_due_period_units`: to set the final `Purchase.due` to a week after it's generated/invoice is sent, use `"...period": 1` and `"...period_units" == "weeks". Required if `is_subscription == true`, read-only otherwise.
See `subscription_due_period`.
If this is `true`, clients are charged at the end of billing periods, and vice-versa. E.g. if you add a subscriber client to a BillingTemplate, with this value being set to `false`, he will receive first invoice today, otherwise - after a single billing period (defined by `subscription_period`/`subscription_period_units`) passes. Required when creating a B…
How many trial periods to give the client prior to starting his billing cycle. If billing period is 1 month and you set this value to 2, subscription will automatically adjust to giving your client 2 months without payments and then charging him for the 3rd month (when exactly depends on `subscription_charge_period_end`: 3 months after the subscriber was lau…
Whether this subscription is paused. Has the same effect as setting `"status": "subscription_paused"` for every BillingTemplateClient launched for this subscription, see the description of `status` on BillingTemplateClient for more details. Ignored (read-only) if `is_subscription == false`.
If this is `true`, there were launched clients (`POST /billing_templates/{id}/add_subscriber/` - or subscribers that were added via the gateway system UI) for this subscription. While this is `false` (it will be as long as you're only just created the template and haven't launched any subscribers), you can edit all of `subscription_*` fields. If this is `…
If the used payment method supports recurring payment functionality, forces the customer's payment credentials to be saved for possible later recurring payments, without giving the customer a choice in the matter.
Array of IDs of related Upsell campaigns.
ID of Referral campaign.
Object type identifier
Object creation time
Object last modification time
Response · 201
OK
curl -X POST "https://gate.safari.tech/api/v1/billing_templates/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'{}/billing_templates/{id}/Retrieve a billing template by ID.
Path parameters
Object ID (UUID)
Response · 200
OK
curl -X GET "https://gate.safari.tech/api/v1/billing_templates/{id}/" \
-H "Authorization: Bearer YOUR_API_KEY"{}/billing_templates/{id}/Update a billing template by ID.
Path parameters
Object ID (UUID)
Request body
Core information about the Purchase, including the products, total, currency and invoice fields. If you're using invoicing via `/billing/` or `/billing_templates/`, this object will be copied 1:1 from BillingTemplate you specify to the resulting Purchases (also to subscription Purchases).
Show child attributes
Currency code in the ISO 4217 standard (e.g. 'EUR'). Default currency is `EUR`.
Line items of the invoice. In case of a transaction with no invoice sent, specify a single Product forming the cost of transaction.
Show child attributes
Product name
Quantity of these products in invoice
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY. You can use this field or `total_override` with a value of 0 to activate preauthorization scenario. See the description of the `Purchase.skip_capture` field.
Total discount per this product in invoice
Percent of tax added to the price of this product
Product category
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Language code in the ISO 639-1 format (e.g. 'en'). Supported values: `az`, `de`, `en`, `en-GB`, `es`, `et`, `fr`, `it`, `lt`, `lv`, `pt`, `pt-BR`, `ru`, `tr`, `uk`.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
Amount of money as the smallest indivisible units of the currency. Examples: 1 cent for EUR and 1 Yen for JPY.
ClientDetails fields to request from the client before the payment. If a value is passed for a field in ClientDetails, it will be automatically removed from this list.
Timezone to localize invoice-specific timestamps in, e.g. to display a concrete date for a `due` timestamp on the invoice.
Whether to permit payments when Purchase's `due` has passed. By default those are permitted (and status will be set to `overdue` once `due` moment is passed). If this is set to `true`, it won't be possible to pay for an overdue invoice, and when `due` is passed the Purchase's status will be set to `expired`.
An optional message to display to your customer in invoice email, e.g. "Your invoice for June".
Custom information with maximum length of 10000 characters
When set to true, prevents retry attempts if the payment fails. The purchase will be immediately marked as cancelled upon failure, and the payer will not see a retry button on the failure page. If not provided, inherits the value from the Company's `single_attempt` setting.
Limits number of billing cycles for each client if set to a non-zero value
Indicates this is a test object, created using test API keys or using Billing section of UI while in test mode.
ID of user who has created this object in the Billing UI, if applicable.
ID of the brand to create this BillingTemplate for. You can copy it down in the API section, see the "specify the ID of the Brand" link in answer to "How to setup payments on website or in mobile app?".
Defines whether this BillingTemplate issues invoices in a recurring manner - it's a subscription - or it sends invoices only once. You can't change this parameter when you edit the BillingTemplate. If this field is `true`, you will need to specify `subscription_*` fields and `invoice_*` fields are read-only, and vice-versa.
Sets `issued` on the Purchase objects generated. Generated from current day in `purchase.timezone` if not provided. Read-only if `is_subscription == true`.
Sets `due` on the Purchase objects generated. Required if `is_subscription == false`, read-only otherwise.
Sets `skip_capture` on the Purchase objects generated. `false` by default. Read-only if `is_subscription == true`.
Sets `send_receipt` on the Purchase objects generated. `true` by default (unlike in Purchases API, where by default receipts are not sent). Read-only if `is_subscription == true`.
Defines how often are the subscription Purchases generated. Used together with `subscription_period_units`: to issue Purchases once a month, use `"...period": 1` and `"...period_units" == "months"`. Variable number of days in a month is respected; e.g. if subscription has a period of 1 month, a client had its billing cycle activated on January 30 and there…
See `subscription_period`.
Used to generate `due` on the Purchase objects generated. Used together with `subscription_due_period_units`: to set the final `Purchase.due` to a week after it's generated/invoice is sent, use `"...period": 1` and `"...period_units" == "weeks". Required if `is_subscription == true`, read-only otherwise.
See `subscription_due_period`.
If this is `true`, clients are charged at the end of billing periods, and vice-versa. E.g. if you add a subscriber client to a BillingTemplate, with this value being set to `false`, he will receive first invoice today, otherwise - after a single billing period (defined by `subscription_period`/`subscription_period_units`) passes. Required when creating a B…
How many trial periods to give the client prior to starting his billing cycle. If billing period is 1 month and you set this value to 2, subscription will automatically adjust to giving your client 2 months without payments and then charging him for the 3rd month (when exactly depends on `subscription_charge_period_end`: 3 months after the subscriber was lau…
Whether this subscription is paused. Has the same effect as setting `"status": "subscription_paused"` for every BillingTemplateClient launched for this subscription, see the description of `status` on BillingTemplateClient for more details. Ignored (read-only) if `is_subscription == false`.
If this is `true`, there were launched clients (`POST /billing_templates/{id}/add_subscriber/` - or subscribers that were added via the gateway system UI) for this subscription. While this is `false` (it will be as long as you're only just created the template and haven't launched any subscribers), you can edit all of `subscription_*` fields. If this is `…
If the used payment method supports recurring payment functionality, forces the customer's payment credentials to be saved for possible later recurring payments, without giving the customer a choice in the matter.
Array of IDs of related Upsell campaigns.
ID of Referral campaign.
Object type identifier
Object creation time
Object last modification time
Response · 200
OK
curl -X PUT "https://gate.safari.tech/api/v1/billing_templates/{id}/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'{}/billing_templates/{id}/Delete a billing template by ID.
Path parameters
Object ID (UUID)
Response · 204
OK
curl -X DELETE "https://gate.safari.tech/api/v1/billing_templates/{id}/" \
-H "Authorization: Bearer YOUR_API_KEY"/billing_templates/{id}/send_invoice/Send an invoice, generating a purchase from billing template data.
Use this request with a BillingTemplate having `is_subscription == false`. Specify the BillingTemplateClient data (only `client_id` field is needed) in the request body. The request will issue a Purchase by combining data of `BillingTemplate.purchase` and `BillingTemplateClient.client` and will send an invoice to your Client. Response will contain data of a created Purchase. The BillingTemplateClient will not be saved.
Path parameters
Object ID (UUID)
Request body
ID of the Client object to add to the BillingTemplate. Read-only after the BillingTemplateClient has been created. Note that the same Client can be added to a BillingTemplate several times.
Only used together with number_of_billing_cycles on BillingTemplate. Shows number of billing cycles passed when number of cycles is limited
When present overrides reference for invoices generated for this client
For subscriptions, you can edit (`PATCH /billing_templates/{id}/clients/{id}/`) this status between `active` and `subscription_paused` values to pause the client's subscription. Paused subscriptions run as normal, except for purchases not being created and invoices sent for them. It means that if you pause a BillingTemplateClient's monthly subscription cycle…
pendinginactiveactivesubscription_pausedIf not null, reports the date when the next billing is scheduled for this client.
An optional whitelist of payment methods availble for purchases generated for this BillingTemplateClient. Copied 1:1 to `Purchase.payment_method_whitelist` field on created Purchases (see its description).
Sends invoice when subscription charge fails if this is `true`
Sends invoice when `POST /billing_templates/{id}/add_subscriber/` is called if this is `true`
Sends receipt when subscription charge succeeds if this is `true`
Object type identifier
Object creation time
Object last modification time
Response · 200
OK
curl -X POST "https://gate.safari.tech/api/v1/billing_templates/{id}/send_invoice/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client_id": "b79d3df6-2f69-4426-acee-eda049d83e18"
}'{}/billing_templates/{id}/add_subscriber/Add a billing template client and activate recurring billing (is_subscription: true).
Use this request with a BillingTemplate having `is_subscription == true`. Two scenarios are possible: • If `subscription_charge_period_end == true` and/or `subscription_trial_periods > 0` (first billing should happen after 1 or more billing periods, not today), the request will create a BillingTemplateClient and start trial/schedule billing for it (as required by subscription settings). Successful response will be of form `{billing_template_client: <BillingTemplateClient object created>, purchase: null}`: no Purchase is created, `BillingTemplateClient.status` is `active` immediately. • If…
Path parameters
Object ID (UUID)
Request body
ID of the Client object to add to the BillingTemplate. Read-only after the BillingTemplateClient has been created. Note that the same Client can be added to a BillingTemplate several times.
Only used together with number_of_billing_cycles on BillingTemplate. Shows number of billing cycles passed when number of cycles is limited
When present overrides reference for invoices generated for this client
For subscriptions, you can edit (`PATCH /billing_templates/{id}/clients/{id}/`) this status between `active` and `subscription_paused` values to pause the client's subscription. Paused subscriptions run as normal, except for purchases not being created and invoices sent for them. It means that if you pause a BillingTemplateClient's monthly subscription cycle…
pendinginactiveactivesubscription_pausedIf not null, reports the date when the next billing is scheduled for this client.
An optional whitelist of payment methods availble for purchases generated for this BillingTemplateClient. Copied 1:1 to `Purchase.payment_method_whitelist` field on created Purchases (see its description).
Sends invoice when subscription charge fails if this is `true`
Sends invoice when `POST /billing_templates/{id}/add_subscriber/` is called if this is `true`
Sends receipt when subscription charge succeeds if this is `true`
Object type identifier
Object creation time
Object last modification time
Response · 200
OK
curl -X POST "https://gate.safari.tech/api/v1/billing_templates/{id}/add_subscriber/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client_id": "b79d3df6-2f69-4426-acee-eda049d83e18"
}'{
"billing_template_client": {},
"purchase": {}
}/billing_templates/{id}/clients/List all billing template clients for this billing template.
Path parameters
Object ID (UUID)
Response · 200
OK
curl -X GET "https://gate.safari.tech/api/v1/billing_templates/{id}/clients/" \
-H "Authorization: Bearer YOUR_API_KEY"{
"results": [
{}
],
"next": "string",
"previous": "string"
}/billing_templates/{id}/clients/{id}/Retrieve a billing template client by client's ID.
Path parameters
Object ID (UUID)
Response · 200
OK
curl -X GET "https://gate.safari.tech/api/v1/billing_templates/{id}/clients/{id}/" \
-H "Authorization: Bearer YOUR_API_KEY"{}/billing_templates/{id}/clients/{id}/Partially update a billing template client by client's ID.
Path parameters
Object ID (UUID)
Request body
ID of the Client object to add to the BillingTemplate. Read-only after the BillingTemplateClient has been created. Note that the same Client can be added to a BillingTemplate several times.
Only used together with number_of_billing_cycles on BillingTemplate. Shows number of billing cycles passed when number of cycles is limited
When present overrides reference for invoices generated for this client
For subscriptions, you can edit (`PATCH /billing_templates/{id}/clients/{id}/`) this status between `active` and `subscription_paused` values to pause the client's subscription. Paused subscriptions run as normal, except for purchases not being created and invoices sent for them. It means that if you pause a BillingTemplateClient's monthly subscription cycle…
pendinginactiveactivesubscription_pausedIf not null, reports the date when the next billing is scheduled for this client.
An optional whitelist of payment methods availble for purchases generated for this BillingTemplateClient. Copied 1:1 to `Purchase.payment_method_whitelist` field on created Purchases (see its description).
Sends invoice when subscription charge fails if this is `true`
Sends invoice when `POST /billing_templates/{id}/add_subscriber/` is called if this is `true`
Sends receipt when subscription charge succeeds if this is `true`
Object type identifier
Object creation time
Object last modification time
Response · 200
OK
curl -X PATCH "https://gate.safari.tech/api/v1/billing_templates/{id}/clients/{id}/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "active"
}'{}Clients
9 endpoints
/clients/List all clients.
Response · 200
OK
curl -X GET "https://gate.safari.tech/api/v1/clients/" \
-H "Authorization: Bearer YOUR_API_KEY"{
"results": [
{
"bank_account": "string",
"bank_code": "string"
}
],
"next": "string",
"previous": "string"
}/clients/Create a new client.
Client is a record of a single customer of your business. Create one for each of your clients; you will be able to issue invoices/subscriptions for them later easily using `/billing_templates/` API. Each BillingTemplateClient (there can be many attached to a single BillingTemplate) will bind a single Client to a BillingTemplate.
Request body
Object type identifier
Object creation time
Object last modification time
Email address
Phone number in the `<country_code> <number>` format
Name and surname of client
Personal identification code of client
Street house number and flat address where applicable
Country code in the ISO 3166-1 alpha-2 format (e.g. 'GB')
City name
ZIP or postal code
State code
Street house number and flat address where applicable
Country code in the ISO 3166-1 alpha-2 format (e.g. 'GB')
City name
ZIP or postal code
State code
Email addresses to receive a carbon copy of all notification emails
Email addresses to receive a blind carbon copy of all notification emails
Legal name of company
Company brand name
Registration number of company
Tax payer registration number
List of delivery methods for invoices
Show child attributes
The method of invoice delivery
emailtext_messageAdditional options for the delivery method
Show child attributes
Custom message for text message delivery
Response · 201
OK
curl -X POST "https://gate.safari.tech/api/v1/clients/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"bank_account": "string",
"bank_code": "string"
}'{
"bank_account": "string",
"bank_code": "string"
}/clients/{id}/Retrieve an object by ID.
Path parameters
Object ID (UUID)
Response · 200
OK
curl -X GET "https://gate.safari.tech/api/v1/clients/{id}/" \
-H "Authorization: Bearer YOUR_API_KEY"{
"bank_account": "string",
"bank_code": "string"
}/clients/{id}/Update a client by ID.
Path parameters
Object ID (UUID)
Request body
Object type identifier
Object creation time
Object last modification time
Email address
Phone number in the `<country_code> <number>` format
Name and surname of client
Personal identification code of client
Street house number and flat address where applicable
Country code in the ISO 3166-1 alpha-2 format (e.g. 'GB')
City name
ZIP or postal code
State code
Street house number and flat address where applicable
Country code in the ISO 3166-1 alpha-2 format (e.g. 'GB')
City name
ZIP or postal code
State code
Email addresses to receive a carbon copy of all notification emails
Email addresses to receive a blind carbon copy of all notification emails
Legal name of company
Company brand name
Registration number of company
Tax payer registration number
List of delivery methods for invoices
Show child attributes
The method of invoice delivery
emailtext_messageAdditional options for the delivery method
Show child attributes
Custom message for text message delivery
Response · 200
OK
curl -X PUT "https://gate.safari.tech/api/v1/clients/{id}/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"bank_account": "string",
"bank_code": "string"
}'{
"bank_account": "string",
"bank_code": "string"
}/clients/{id}/Partially update a client by ID.
Path parameters
Object ID (UUID)
Request body
Object type identifier
Object creation time
Object last modification time
Email address
Phone number in the `<country_code> <number>` format
Name and surname of client
Personal identification code of client
Street house number and flat address where applicable
Country code in the ISO 3166-1 alpha-2 format (e.g. 'GB')
City name
ZIP or postal code
State code
Street house number and flat address where applicable
Country code in the ISO 3166-1 alpha-2 format (e.g. 'GB')
City name
ZIP or postal code
State code
Email addresses to receive a carbon copy of all notification emails
Email addresses to receive a blind carbon copy of all notification emails
Legal name of company
Company brand name
Registration number of company
Tax payer registration number
List of delivery methods for invoices
Show child attributes
The method of invoice delivery
emailtext_messageAdditional options for the delivery method
Show child attributes
Custom message for text message delivery
Response · 200
OK
curl -X PATCH "https://gate.safari.tech/api/v1/clients/{id}/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"bank_account": "string",
"bank_code": "string"
}'{
"bank_account": "string",
"bank_code": "string"
}/clients/{id}/Delete a client by ID.
Path parameters
Object ID (UUID)
Response · 204
OK
curl -X DELETE "https://gate.safari.tech/api/v1/clients/{id}/" \
-H "Authorization: Bearer YOUR_API_KEY"/clients/{id}/recurring_tokens/List recurring tokens saved for a client.
All of these tokens will be available in a checkout (see `Purchase.checkout_url`) if you create a Purchase with this client's ID in `client_id` field. You can use one in `POST /purchases/{id}/charge/`, too. Note that you can use one client's `recurring_token` to pay a Purchase created for a different `client_id` or created with no `client_id` at all; it's not recommended to do this.
Path parameters
Object ID (UUID)
Response · 200
OK
curl -X GET "https://gate.safari.tech/api/v1/clients/{id}/recurring_tokens/" \
-H "Authorization: Bearer YOUR_API_KEY"{
"results": [
{}
],
"next": "string",
"previous": "string"
}/clients/{id}/recurring_tokens/{id}/Retrieve an object by ID.
Path parameters
Object ID (UUID)
Response · 200
OK
curl -X GET "https://gate.safari.tech/api/v1/clients/{id}/recurring_tokens/{id}/" \
-H "Authorization: Bearer YOUR_API_KEY"{}/clients/{id}/recurring_tokens/{id}/Delete a client recurring token by ID.
If you create the Purchase with the respective Client's ID (in `.client_id`), he won't see this token as available on checkout page anymore. You also won't be able to use the ID of this object as a `recurring_token` in `POST /purchases/{id}/charge/`. The respective Purchase will have `is_recurring_token` set to `false` (as if `POST /purchases/{recurring_token}/delete_recurring_token/` was issued).
Path parameters
Object ID (UUID)
Response · 204
OK
curl -X DELETE "https://gate.safari.tech/api/v1/clients/{id}/recurring_tokens/{id}/" \
-H "Authorization: Bearer YOUR_API_KEY"Webhooks
7 endpoints
/webhooks/List all webhooks.
Response · 200
OK
curl -X GET "https://gate.safari.tech/api/v1/webhooks/" \
-H "Authorization: Bearer YOUR_API_KEY"{
"results": [
{
"title": "string",
"all_events": false,
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA6gLlBKxCB5dxPJbinCzl\nhOfKSgQtOWQQBxmnWIkEVUbqhpnqr3xNYiAvDyMUxYUwuzN44eHO+mR9MZWcSx3c\nbXmKa3gsOzR6GdcOxMGaVxvfje+fujCAlCtO1BP+A9/FS3KcPgCYG1wtAPwA5IAf\nHylL3TsUVIJQFBgiBr6N4Bgapr9eloaFfeYIBRsXmxPKAMJivqxYpLh0V3N4ZFd5\nTGqSEAa4b1ULDr6p0sB2L3QikTdsF0zp03zNceKA6fXDOzD0xWtg9buXvyKwePK4\nM2kcnWBNfsWghrdg0fG3O9bmkaS1oEXydrmJfuiI8h6a64J/1nzooi2yLC9D6Ta0\nS63bbuAHymnQtiNuV7Ixp6IoTGFaS88aTiHaP8rdyWV8JTDFx0qeDzyaGWiYGwEF\nmj/buHCEcRhoajbGkPhYA4YEdn4jy1wZhEr2OMdBPM7mPPI0Hy3hcNJVMVVlrpHe\nIltQATpjlNaJMlRPjbcaiW7dsO3BuF9ZOMGksSOnyYm/AgMBAAE=\n-----END PUBLIC KEY-----",
"events": [
"purchase.created"
],
"callback": "https://example.com"
}
],
"next": "string",
"previous": "string"
}/webhooks/Create a new webhook.
Request body
Object type identifier
Object creation time
Object last modification time
Arbitrary title of webhook
Specifies this webhook should trigger on all event types. Either this or `events` is required.
PEM-encoded RSA public key for authenticating webhook or callback payloads
List of events to trigger webhook callbacks for. Either this or `all_events` is required.
Response · 201
OK
curl -X POST "https://gate.safari.tech/api/v1/webhooks/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "string",
"all_events": false,
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA6gLlBKxCB5dxPJbinCzl\nhOfKSgQtOWQQBxmnWIkEVUbqhpnqr3xNYiAvDyMUxYUwuzN44eHO+mR9MZWcSx3c\nbXmKa3gsOzR6GdcOxMGaVxvfje+fujCAlCtO1BP+A9/FS3KcPgCYG1wtAPwA5IAf\nHylL3TsUVIJQFBgiBr6N4Bgapr9eloaFfeYIBRsXmxPKAMJivqxYpLh0V3N4ZFd5\nTGqSEAa4b1ULDr6p0sB2L3QikTdsF0zp03zNceKA6fXDOzD0xWtg9buXvyKwePK4\nM2kcnWBNfsWghrdg0fG3O9bmkaS1oEXydrmJfuiI8h6a64J/1nzooi2yLC9D6Ta0\nS63bbuAHymnQtiNuV7Ixp6IoTGFaS88aTiHaP8rdyWV8JTDFx0qeDzyaGWiYGwEF\nmj/buHCEcRhoajbGkPhYA4YEdn4jy1wZhEr2OMdBPM7mPPI0Hy3hcNJVMVVlrpHe\nIltQATpjlNaJMlRPjbcaiW7dsO3BuF9ZOMGksSOnyYm/AgMBAAE=\n-----END PUBLIC KEY-----",
"events": [
"purchase.created"
],
"callback": "https://example.com"
}'{
"title": "string",
"all_events": false,
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA6gLlBKxCB5dxPJbinCzl\nhOfKSgQtOWQQBxmnWIkEVUbqhpnqr3xNYiAvDyMUxYUwuzN44eHO+mR9MZWcSx3c\nbXmKa3gsOzR6GdcOxMGaVxvfje+fujCAlCtO1BP+A9/FS3KcPgCYG1wtAPwA5IAf\nHylL3TsUVIJQFBgiBr6N4Bgapr9eloaFfeYIBRsXmxPKAMJivqxYpLh0V3N4ZFd5\nTGqSEAa4b1ULDr6p0sB2L3QikTdsF0zp03zNceKA6fXDOzD0xWtg9buXvyKwePK4\nM2kcnWBNfsWghrdg0fG3O9bmkaS1oEXydrmJfuiI8h6a64J/1nzooi2yLC9D6Ta0\nS63bbuAHymnQtiNuV7Ixp6IoTGFaS88aTiHaP8rdyWV8JTDFx0qeDzyaGWiYGwEF\nmj/buHCEcRhoajbGkPhYA4YEdn4jy1wZhEr2OMdBPM7mPPI0Hy3hcNJVMVVlrpHe\nIltQATpjlNaJMlRPjbcaiW7dsO3BuF9ZOMGksSOnyYm/AgMBAAE=\n-----END PUBLIC KEY-----",
"events": [
"purchase.created"
],
"callback": "https://example.com"
}/webhooks/{id}/Retrieve an object by ID.
Path parameters
Object ID (UUID)
Response · 200
OK
curl -X GET "https://gate.safari.tech/api/v1/webhooks/{id}/" \
-H "Authorization: Bearer YOUR_API_KEY"{
"title": "string",
"all_events": false,
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA6gLlBKxCB5dxPJbinCzl\nhOfKSgQtOWQQBxmnWIkEVUbqhpnqr3xNYiAvDyMUxYUwuzN44eHO+mR9MZWcSx3c\nbXmKa3gsOzR6GdcOxMGaVxvfje+fujCAlCtO1BP+A9/FS3KcPgCYG1wtAPwA5IAf\nHylL3TsUVIJQFBgiBr6N4Bgapr9eloaFfeYIBRsXmxPKAMJivqxYpLh0V3N4ZFd5\nTGqSEAa4b1ULDr6p0sB2L3QikTdsF0zp03zNceKA6fXDOzD0xWtg9buXvyKwePK4\nM2kcnWBNfsWghrdg0fG3O9bmkaS1oEXydrmJfuiI8h6a64J/1nzooi2yLC9D6Ta0\nS63bbuAHymnQtiNuV7Ixp6IoTGFaS88aTiHaP8rdyWV8JTDFx0qeDzyaGWiYGwEF\nmj/buHCEcRhoajbGkPhYA4YEdn4jy1wZhEr2OMdBPM7mPPI0Hy3hcNJVMVVlrpHe\nIltQATpjlNaJMlRPjbcaiW7dsO3BuF9ZOMGksSOnyYm/AgMBAAE=\n-----END PUBLIC KEY-----",
"events": [
"purchase.created"
],
"callback": "https://example.com"
}/webhooks/{id}/Update a webhook by ID.
Path parameters
Object ID (UUID)
Request body
Object type identifier
Object creation time
Object last modification time
Arbitrary title of webhook
Specifies this webhook should trigger on all event types. Either this or `events` is required.
PEM-encoded RSA public key for authenticating webhook or callback payloads
List of events to trigger webhook callbacks for. Either this or `all_events` is required.
Response · 200
OK
curl -X PUT "https://gate.safari.tech/api/v1/webhooks/{id}/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "string",
"all_events": false,
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA6gLlBKxCB5dxPJbinCzl\nhOfKSgQtOWQQBxmnWIkEVUbqhpnqr3xNYiAvDyMUxYUwuzN44eHO+mR9MZWcSx3c\nbXmKa3gsOzR6GdcOxMGaVxvfje+fujCAlCtO1BP+A9/FS3KcPgCYG1wtAPwA5IAf\nHylL3TsUVIJQFBgiBr6N4Bgapr9eloaFfeYIBRsXmxPKAMJivqxYpLh0V3N4ZFd5\nTGqSEAa4b1ULDr6p0sB2L3QikTdsF0zp03zNceKA6fXDOzD0xWtg9buXvyKwePK4\nM2kcnWBNfsWghrdg0fG3O9bmkaS1oEXydrmJfuiI8h6a64J/1nzooi2yLC9D6Ta0\nS63bbuAHymnQtiNuV7Ixp6IoTGFaS88aTiHaP8rdyWV8JTDFx0qeDzyaGWiYGwEF\nmj/buHCEcRhoajbGkPhYA4YEdn4jy1wZhEr2OMdBPM7mPPI0Hy3hcNJVMVVlrpHe\nIltQATpjlNaJMlRPjbcaiW7dsO3BuF9ZOMGksSOnyYm/AgMBAAE=\n-----END PUBLIC KEY-----",
"events": [
"purchase.created"
],
"callback": "https://example.com"
}'{
"title": "string",
"all_events": false,
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA6gLlBKxCB5dxPJbinCzl\nhOfKSgQtOWQQBxmnWIkEVUbqhpnqr3xNYiAvDyMUxYUwuzN44eHO+mR9MZWcSx3c\nbXmKa3gsOzR6GdcOxMGaVxvfje+fujCAlCtO1BP+A9/FS3KcPgCYG1wtAPwA5IAf\nHylL3TsUVIJQFBgiBr6N4Bgapr9eloaFfeYIBRsXmxPKAMJivqxYpLh0V3N4ZFd5\nTGqSEAa4b1ULDr6p0sB2L3QikTdsF0zp03zNceKA6fXDOzD0xWtg9buXvyKwePK4\nM2kcnWBNfsWghrdg0fG3O9bmkaS1oEXydrmJfuiI8h6a64J/1nzooi2yLC9D6Ta0\nS63bbuAHymnQtiNuV7Ixp6IoTGFaS88aTiHaP8rdyWV8JTDFx0qeDzyaGWiYGwEF\nmj/buHCEcRhoajbGkPhYA4YEdn4jy1wZhEr2OMdBPM7mPPI0Hy3hcNJVMVVlrpHe\nIltQATpjlNaJMlRPjbcaiW7dsO3BuF9ZOMGksSOnyYm/AgMBAAE=\n-----END PUBLIC KEY-----",
"events": [
"purchase.created"
],
"callback": "https://example.com"
}/webhooks/{id}/Partially update a webhook by ID.
Path parameters
Object ID (UUID)
Request body
Object type identifier
Object creation time
Object last modification time
Arbitrary title of webhook
Specifies this webhook should trigger on all event types. Either this or `events` is required.
PEM-encoded RSA public key for authenticating webhook or callback payloads
List of events to trigger webhook callbacks for. Either this or `all_events` is required.
Response · 200
OK
curl -X PATCH "https://gate.safari.tech/api/v1/webhooks/{id}/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "string",
"all_events": false,
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA6gLlBKxCB5dxPJbinCzl\nhOfKSgQtOWQQBxmnWIkEVUbqhpnqr3xNYiAvDyMUxYUwuzN44eHO+mR9MZWcSx3c\nbXmKa3gsOzR6GdcOxMGaVxvfje+fujCAlCtO1BP+A9/FS3KcPgCYG1wtAPwA5IAf\nHylL3TsUVIJQFBgiBr6N4Bgapr9eloaFfeYIBRsXmxPKAMJivqxYpLh0V3N4ZFd5\nTGqSEAa4b1ULDr6p0sB2L3QikTdsF0zp03zNceKA6fXDOzD0xWtg9buXvyKwePK4\nM2kcnWBNfsWghrdg0fG3O9bmkaS1oEXydrmJfuiI8h6a64J/1nzooi2yLC9D6Ta0\nS63bbuAHymnQtiNuV7Ixp6IoTGFaS88aTiHaP8rdyWV8JTDFx0qeDzyaGWiYGwEF\nmj/buHCEcRhoajbGkPhYA4YEdn4jy1wZhEr2OMdBPM7mPPI0Hy3hcNJVMVVlrpHe\nIltQATpjlNaJMlRPjbcaiW7dsO3BuF9ZOMGksSOnyYm/AgMBAAE=\n-----END PUBLIC KEY-----",
"events": [
"purchase.created"
],
"callback": "https://example.com"
}'{
"title": "string",
"all_events": false,
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA6gLlBKxCB5dxPJbinCzl\nhOfKSgQtOWQQBxmnWIkEVUbqhpnqr3xNYiAvDyMUxYUwuzN44eHO+mR9MZWcSx3c\nbXmKa3gsOzR6GdcOxMGaVxvfje+fujCAlCtO1BP+A9/FS3KcPgCYG1wtAPwA5IAf\nHylL3TsUVIJQFBgiBr6N4Bgapr9eloaFfeYIBRsXmxPKAMJivqxYpLh0V3N4ZFd5\nTGqSEAa4b1ULDr6p0sB2L3QikTdsF0zp03zNceKA6fXDOzD0xWtg9buXvyKwePK4\nM2kcnWBNfsWghrdg0fG3O9bmkaS1oEXydrmJfuiI8h6a64J/1nzooi2yLC9D6Ta0\nS63bbuAHymnQtiNuV7Ixp6IoTGFaS88aTiHaP8rdyWV8JTDFx0qeDzyaGWiYGwEF\nmj/buHCEcRhoajbGkPhYA4YEdn4jy1wZhEr2OMdBPM7mPPI0Hy3hcNJVMVVlrpHe\nIltQATpjlNaJMlRPjbcaiW7dsO3BuF9ZOMGksSOnyYm/AgMBAAE=\n-----END PUBLIC KEY-----",
"events": [
"purchase.created"
],
"callback": "https://example.com"
}/webhooks/{id}/Delete a webhook by ID.
Path parameters
Object ID (UUID)
Response · 204
OK
curl -X DELETE "https://gate.safari.tech/api/v1/webhooks/{id}/" \
-H "Authorization: Bearer YOUR_API_KEY"/webhooks/deliveries/List webhook deliveries for a specific object.
Returns a paginated list of webhook deliveries for a specific source object (Purchase, Payment, Payout, or BillingTemplateClient). You must provide both `id` and `source_type` query parameters to identify the object whose webhook deliveries you want to retrieve. Deliveries show the complete history of webhook attempts for the specified object, including successful deliveries, failures, and retries.
Query parameters
ID of the source object (Purchase, Payment, Payout, or BillingTemplateClient) to retrieve webhook deliveries for.
Type of the source object.
Response · 200
OK
curl -X GET "https://gate.safari.tech/api/v1/webhooks/deliveries/" \
-H "Authorization: Bearer YOUR_API_KEY"{
"next": null,
"previous": null,
"results": [
{
"created_on": "2025-08-19T07:29:25.612314Z",
"delivered_on": null,
"attempts": 0,
"delivery_attempts": [],
"url": "https://example.com/webhook",
"event": "purchase.created",
"payload": {
"example": "value"
}
}
]
}Payment methods
1 endpoint
/payment_methods/Get the list of payment methods available for your purchase.
Send this request providing, at the very least, the `brand_id` and `currency` query parameters having the same values you'd use to create your Purchase. Be sure to use the same API key you'll create your Purchase with; it will define the test_mode setting used in the lookup. In the response body you'll receive an object with `available_payment_methods` property containing the list of payment method names available to use with your Purchase (e.g. those codes can be used in `payment_method_whitelist` field or with `?preferred={payment_method}` option of `checkout_url`). Please note that all lo…
Query parameters
Which brand would you like to lookup the available payment methods for. Use the same value (UUID) you'd set the `Purchase.brand_id` to.
Currency you'd use in your Purchase in ISO 4217 format, e.g. `EUR`.
Country code in the ISO 3166-1 alpha-2 format (e.g. `GB`). Optional.
If provided in the format of `recurring=true`, will filter out the methods that don't support recurring charges (see `POST /purchases/{id}/charge/`).
If provided in the format of `skip_capture=true`, will filter out the methods that don't support `skip_capture` functionality (see the description for `Purchase.skip_capture field`).
If provided in the format of `preauthorization=true`, will filter out the methods that don't support preauthorization functionality (see the description for `Purchase.skip_capture field`).
Language code in the ISO 639-1 format (e.g. 'en'). Optional.
Response · 200
OK
curl -X GET "https://gate.safari.tech/api/v1/payment_methods/" \
-H "Authorization: Bearer YOUR_API_KEY"{
"available_payment_methods": [
"visa",
"mastercard",
"some_method"
],
"by_country": {
"any": [
"card"
],
"GB": [
"some_method"
]
},
"country_names": {
"any": "Other",
"GB": "United Kingdom"
},
"names": {
"visa": "Visa",
"mastercard": "Mastercard",
"some_method": "Some method"
},
"logos": {
"some_method": [
"/static/images/icon-visa.svg",
"/static/images/icon-mastercard.svg",
"/static/images/icon-maestro.svg"
],
"visa": "/static/images/icon-visa.svg",
"mastercard": "/static/images/icon-mastercard.svg"
},
"card_methods": [
"american_express",
"visa"
]
}Payout methods
1 endpoint
/payout_methods/Get the list of payout methods available for your payout.
Send this request providing, at the very least, the `brand_id` and `currency` query parameters having the same values you'd use to create your Payout. Be sure to use the same API key you'll create your Payout with; it will define the test_mode setting used in the lookup. In the response body you'll receive an object with `available_payout_methods` property containing the list of payout method names available to use with your Payout (e.g. those codes can be used in `payout_method_whitelist` field). Please note that all lookup arguments must be provided via query parameters after the endpoint,…
Query parameters
Which brand would you like to lookup the available payout methods for. Use the same value (UUID) you'd set the `Payout.brand_id` to.
Currency you'd use in your Payout in ISO 4217 format, e.g. `EUR`.
Language code in the ISO 639-1 format (e.g. 'en'). Optional.
Response · 200
OK
curl -X GET "https://gate.safari.tech/api/v1/payout_methods/" \
-H "Authorization: Bearer YOUR_API_KEY"{
"available_payout_methods": [
"visa",
"mastercard",
"some_method"
],
"names": {
"visa": "Visa",
"mastercard": "Mastercard",
"some_method": "Some method"
},
"logos": {
"some_method": [
"/static/images/icon-visa.svg",
"/static/images/icon-mastercard.svg",
"/static/images/icon-maestro.svg"
],
"visa": "/static/images/icon-visa.svg",
"mastercard": "/static/images/icon-mastercard.svg"
},
"card_methods": [
"american_express",
"visa"
]
}Account
2 endpoints
/account/json/balance/Get company balance.
Returns the company balance according to the provided query string filters. Multiple values can be provided for all filters except `from` and `to`, including all results matching any of these values.
Query parameters
Retrieve a past balance value at a specific Unix timestamp
Response · 200
Company balance successfully retrieved
curl -X GET "https://gate.safari.tech/api/v1/account/json/balance/" \
-H "Authorization: Bearer YOUR_API_KEY"{
"EUR": {
"balance": 93408,
"fee_sell": 0,
"reserved": 0,
"gross_balance": 93408,
"pending_outgoing": 0,
"available_balance": 93408
},
"RUB": {
"balance": 1111840,
"fee_sell": 360,
"reserved": 0,
"gross_balance": 1112200,
"pending_outgoing": 0,
"available_balance": 1111840
},
"USD": {
"balance": -35420,
"fee_sell": 1880,
"reserved": 0,
"gross_balance": -33540,
"pending_outgoing": 0,
"available_balance": -35420
}
}/account/json/turnover/Get company turnover.
Fetches the company turnover according to the provided query string filters. Must provide exactly one `currency` filter. Multiple values can be provided for all filters except `currency`, `from` and `to`, including all results matching any of these values.
Response · 200
Company turnover successfully retrieved
curl -X GET "https://gate.safari.tech/api/v1/account/json/turnover/" \
-H "Authorization: Bearer YOUR_API_KEY"{
"incoming": {
"turnover": 93408,
"fee_sell": 1750,
"count": {
"all": 175
}
},
"outgoing": {
"turnover": 93408,
"fee_sell": 1750,
"count": {
"all": 175
}
}
}Balance
1 endpoint
/balance/Get balance data.
Returns balance data, including ecommerce and bank accounts.
Response · 200
Balance data successfully retrieved
curl -X GET "https://gate.safari.tech/api/v1/balance/" \
-H "Authorization: Bearer YOUR_API_KEY"{
"ecommerce": [
{
"currency": "GBP",
"gross_balance": 3232409,
"balance": 3232409,
"available_balance": 3185444,
"reserved": 0,
"pending_outgoing": 46965,
"fee_sell": 0,
"payout_gross_balance": 0,
"payout_balance": 0,
"available_payout_balance": 0,
"pending_payouts": 0,
"payout_overdraft": 0,
"payout_fee_sell": 0
},
{
"currency": "USD",
"gross_balance": 3827891,
"balance": 3827891,
"available_balance": 3802744,
"reserved": 0,
"pending_outgoing": 25147,
"fee_sell": 0,
"payout_gross_balance": 0,
"payout_balance": 0,
"available_payout_balance": 0,
"pending_payouts": 0,
"payout_overdraft": 0,
"payout_fee_sell": 0
},
{
"currency": "EUR",
"gross_balance": 7763713,
"balance": 7763713,
"available_balance": 7729281,
"reserved": 0,
"pending_outgoing": 34432,
"fee_sell": 0,
"payout_gross_balance": 0,
"payout_balance": 0,
"available_payout_balance": 0,
"pending_payouts": 0,
"payout_overdraft": 0,
"payout_fee_sell": 0
}
],
"bank_accounts": [
{
"id": "9088acbc-54e5-4ff0-8b94-d08f855aa09c",
"iban": "GB29NWBK60161331926819",
"swift": "SPELGB11",
"bank_account": "TEST",
"bank_code": "SG0000000001",
"real_bank_account": "GB29NWBK60161331926819",
"real_bank_code": "SPELGB11",
"currency": "GBP",
"status": "active",
"name": "",
"reference": "SPELGB11",
"available_balance": 9996003,
"reserved_balance": 3385,
"extended_ui": null,
"fx_currencies": [
"EUR",
"USD",
"GBP"
]
},
{
"id": "d6f63e07-4954-42e0-a87c-45167bd2e401",
"iban": "DE00SPEL00000000005882",
"swift": "SPELDE66",
"bank_account": "",
"bank_code": "",
"real_bank_account": "DE00SPEL00000000005882",
"real_bank_code": "SPELDE66",
"currency": "EUR",
"status": "active",
"name": "Account 1",
"reference": null,
"available_balance": 12567256,
"reserved_balance": 0,
"extended_ui": null,
"fx_currencies": []
}
],
"payout_balances_enabled": {
"EUR": false,
"GBP": false,
"USD": false
}
}Company Statements
4 endpoints
/company_statements/List all generated statements.
Response · 200
OK
curl -X GET "https://gate.safari.tech/api/v1/company_statements/" \
-H "Authorization: Bearer YOUR_API_KEY"{
"results": [
{
"format": "string",
"timezone": "Europe/Oslo"
}
],
"next": "string",
"previous": "string"
}/company_statements/Schedule a statement generation.
With this request, you can schedule a statement generation for a company. In a response, you will get an object with the following structure. Main fields to look out for here are `id`, `status` and `download_url`.
Request body
Statement format, available formats: `csv`, `xlsx`.
Timezone to localize statement-specific timestamps
Indicates this is a test object, created using test API keys or using Billing section of UI while in test mode.
ID of the Company.
Query parameters used to generate statement.
Status of statement generation e.g. `pending`, `processing`, `success`.
Download URL of a statement.
Date and time for the beginning of statement generation process.
Date and time for finishing the statement generation process.
Object creation time
Object last modification time
Statement request type
ID of a statement
Response · 201
OK
curl -X POST "https://gate.safari.tech/api/v1/company_statements/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"format": "csv",
"timezone": "UTC"
}'{
"format": "string",
"timezone": "Europe/Oslo"
}/company_statements/{id}/Retrieve a statement by ID.
Path parameters
Object ID (UUID)
Response · 200
OK
curl -X GET "https://gate.safari.tech/api/v1/company_statements/{id}/" \
-H "Authorization: Bearer YOUR_API_KEY"{
"format": "string",
"timezone": "Europe/Oslo"
}/company_statements/{id}/cancel/Cancel a statement generation by ID.
Path parameters
Object ID (UUID)
Response · 200
OK
curl -X POST "https://gate.safari.tech/api/v1/company_statements/{id}/cancel/" \
-H "Authorization: Bearer YOUR_API_KEY"{
"format": "string",
"timezone": "Europe/Oslo"
}Public Key
1 endpoint
/public_key/Get a callback public key.
Returns public key for authenticating company callback payloads
Response · 200
Public key for authenticating callback payloads
curl -X GET "https://gate.safari.tech/api/v1/public_key/" \
-H "Authorization: Bearer YOUR_API_KEY""-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA6gLlBKxCB5dxPJbinCzl\nhOfKSgQtOWQQBxmnWIkEVUbqhpnqr3xNYiAvDyMUxYUwuzN44eHO+mR9MZWcSx3c\nbXmKa3gsOzR6GdcOxMGaVxvfje+fujCAlCtO1BP+A9/FS3KcPgCYG1wtAPwA5IAf\nHylL3TsUVIJQFBgiBr6N4Bgapr9eloaFfeYIBRsXmxPKAMJivqxYpLh0V3N4ZFd5\nTGqSEAa4b1ULDr6p0sB2L3QikTdsF0zp03zNceKA6fXDOzD0xWtg9buXvyKwePK4\nM2kcnWBNfsWghrdg0fG3O9bmkaS1oEXydrmJfuiI8h6a64J/1nzooi2yLC9D6Ta0\nS63bbuAHymnQtiNuV7Ixp6IoTGFaS88aTiHaP8rdyWV8JTDFx0qeDzyaGWiYGwEF\nmj/buHCEcRhoajbGkPhYA4YEdn4jy1wZhEr2OMdBPM7mPPI0Hy3hcNJVMVVlrpHe\nIltQATpjlNaJMlRPjbcaiW7dsO3BuF9ZOMGksSOnyYm/AgMBAAE=\n-----END PUBLIC KEY-----"Ready to integrate?
Get an API key, test with sandbox cards, and go live the same week. Our solutions team is on call.