Our API allows users to purchase shipping credits, which are required for creating shipments using OTO delivery options without a contract. This guide explains how to buy shipping credit using the buyShippingCredit endpoint.
Instructions
Step 1: API Endpoint
- To purchase shipping credit, use the following POSTendpoint:
https://api.tryoto.com/rest/v2/buyShippingCredit
Step 2: Authorization
- A valid Bearer Token must be included in the request headers for authentication
Step 3: Request Body Parameters
- The request body should be in JSON format and include the following field:
| Field Name | Required | Type | Description |
|---|---|---|---|
amount | Yes | Number | The amount of credit to be purchased. |
Step 4: Example Request
Using cURL:
curl --location 'https://api.tryoto.com/rest/v2/buyShippingCredit' \ --data '{ "amount": 11.50 }'
Step 5: Example Response
- A successful response will return a payment URL, allowing the user to complete the transaction:
{ "success": true, "paymentURL": "https://checkout.payments.tap.company?mode=page&token=60c9c154d2b4650d89xxxx" }