Web Services Detail
Product
Product will be used to get the list of products that you are eligible for (currently active). There are 2 cases for the Product List API with details a`s follow:
- Get all active product
- Get specific product information
- Deals product detail
Get all active product
This API will return all the products that are active and eligible for the partner.
Here's a Markdown table for the given data:
Field | Value |
---|---|
Endpoint | /v2/product-list/ |
HTTP Method | GET |
Response |
|
Product List Response Description
Property | Data Format | Description |
---|---|---|
type | String | - |
id | String | Product code for the product |
attributes | Object | Object wrapper for response data |
is_inquiry | Boolean | Mark if the product needs to do inquiry or not |
product_name | String | The name of the product |
price | int | The price that Tokopedia sells to the client. The value will be based on the business arrangement |
status | int | Status of the product: |
1 = Active | ||
2 = Inactive (if the product is toggled off intentionally due to a specific use case, e.g., no longer available from the operator) | ||
3 = Temporarily Inactive (if the product is temporarily unavailable due to issues from the operator or supplier) |
Get specific product information
This API will check whether the product code is opened for the partner. This capability uses the product code as the filter.
Field | Value |
---|---|
Endpoint | /v2/product-list?product_code=<<product_codes>> e.g: /v2/product-list?product_code=15k-xl,kode-voucher-google-100k |
HTTP Method | GET |
Response (Product Found) |
|
Response (Product Not Found) |
|
Product List with Filter Response Description
Property | Data Format | Description |
---|---|---|
type | String | - |
id | String | Product code for the product |
attributes | Object | Object wrapper for response data |
is_inquiry | Boolean | Mark if the product needs to do inquiry or not |
product_name | String | The name of the product |
price | int | The price that Tokopedia sells to the client. The value will be based on the business arrangement |
status | int | Status of the product: |
1 = Active | ||
2 = Inactive (if the product is toggled off intentionally due to a specific use case, e.g., no longer available from the operator) | ||
3 = Temporarily Inactive (if the product is temporarily unavailable due to issues from the operator or supplier) |
Deals Product Detail
This endpoint specifically to fetch additional information needed for Deals (Food & Voucher) product like description, expiry date, tnc, outlets, etc.
Field | Value |
---|---|
Endpoint | /v2/product-list/deals |
HTTP Method | GET |
Response |
|
Deals Product Detail - response field description
Property | Data Format | Description |
---|---|---|
type | String | - |
id | String | Product code for the product |
attributes | Object | Object wrapper for response data |
desc_long | String | Long description version of the product |
desc_short | String | Short description version of the product (not all products will have a short description version) |
image_large | String | Image URL with a larger size |
image_small | String | Image URL with a smaller size |
end_date | String | Product availability end date (formatted as dd MMM yyyy) |
outlets | Array of Object | List of outlet data |
name | String | Outlet's name |
district | String | Outlet's location address |
coordinate | String | Google Maps coordinates for the outlet location |
tnc | String | Terms and conditions of the product |
Inquiry
Inquiry will be used only for checking user bills for specific products such as PDAM, PLN, etc. Products that need to use the Inquiry API are defined in the response of Product List API on the is_inquiry field.
Field | Value |
---|---|
Endpoint | /v2/inquiry |
HTTP Method | POST |
Request Payload |
|
Response Payload |
|
- Inquiry Request
- Inquiry Response
Parameter | Data Format | Description | Required |
---|---|---|---|
product_code | String | - | Mandatory |
client_number | String | - | Mandatory |
fields | Array | Fields that contain extra parameters for specific products that need bills amount checking before transaction | Optional |
Property | Data Format | Description |
---|---|---|
type | String | - |
attributes | Object | Object wrapper for response data |
product_code | String | Product identifier |
client_number | String | Number inputted by the end-user |
fields | Array | Fields contain extra parameters for specific products. Fields are part of the client_number parameter for some products that need more than one client number to pay the bill |
sales_price | Number | Bill amount that the user needs to pay. Sales price includes the admin fee. |
inquiry_result | Array | Inquiry results contain bill information for specific products that need to display extra information. Note: Every product has different inquiry results |
admin_fee | Number | Amount charged to the user as a transaction fee |
base_price | Number | Price before adding the admin fee (sales price - admin fee) |
client_name | String | Customer name in bill payment product |
client_number | String | Customer number in bill payment product |
meter_id | String | ID meter in PLN Postpaid product |
Checkout
Checkout will be used for creating new orders, every partner’s checkout request needs to generate request_id as identifier and. A signature header is required
The request_id is an identifier that uniquely identifies the transaction and will be used globally as an identifier for that specific transaction.
*Please note that SATRIAN does not responsible for duplicate transactions request generated by client.Field | Value |
---|---|
Endpoint | /v2/order |
HTTP Method | POST |
Request Payload |
|
Response Payload |
|
- Checkout Request
- Checkout Response
Parameter | Data Format | Description | Required |
---|---|---|---|
type | String | API type. Fill with "order" in order API | Mandatory |
id | String | Unique for order request, generated by the client. Max 50 characters (alphanumeric) | Mandatory |
product_code | String | Code that determines the product | Mandatory |
client_number | String | Number inputted by the end-user | Mandatory |
amount | Number | Order amount. | Non-inquiry: optional Inquiry: Mandatory |
fields | Array | Fields contain extra parameters for specific products. | Optional |
Property | Data Format | Description |
---|---|---|
type | String | API type. For order API, it will be filled with "order" |
id | String | Unique for order request, generated by the client. Max 50 characters (alphanumeric) |
attributes | Object | Object Wrapper for response data |
client_number | String | Number inputted by the end-user |
error_code | String | Code that represents the error state |
error_detail | String | Error description |
fields | Array | Fields contain extra parameters for specific products. Fields are part of the client_number parameter for some products that need more than 1 client number parameter to pay the bill. |
fulfilled_at | Datetime | Time when the order changed to final status with format RFC3339. Value will be filled if the status is successful. |
partner_fee | Number | Amount of fee that will be received by partner |
product_code | String | Product Identifier |
sales_price | Number | Amount that user needs to pay. Sales_price includes admin fee. |
status | String | Current state of order request, please refer to Order Status Reference |
Order Details
Order Details purpose is to get the current status for a specific order using request_id as an identifier.
Note: we are generating signature at the order detail response header. You can utilize this if you want to
Case 1: Order with Success status (Generate Payment Receipt)
Field | Value |
---|---|
Endpoint | /v2/order/<<request_id>> |
HTTP Method | GET |
Response |
|
To generate payment receipt, partner needs to use data from the fulfillment result array. Each product has a different format payment receipt. Please refer to Bukti Bayar Template document that will be provided separate by SATRIAN Team.
Case 2: Order with Pending status
Field | Value |
---|---|
Endpoint | /v2/order/<<request_id>> |
HTTP Method | GET |
Response |
|
Case 3: Order with Failed status
Field | Value |
---|---|
Endpoint | /v2/order/<<request_id>> |
HTTP Method | GET |
Response |
|
Error_code and error_detail will only be filled for Failed transaction. Error code and error detail will inform the failed reason of a transaction. The description of error_code and error_detail is described in section 4.8 .
Response Description
Property | Data Format | Description |
---|---|---|
type | String | |
id | String | Identifier for order request, generated by user |
attributes | Object | Object Wrapper for response data |
client_number | String | Number inputted by end user |
fields | Array | Fields will contains extra parameter for specific product who need bills amount checking before transaction |
fulfilled_at | Datetime | Time when order changed to final status with format RFC3339. Value will be filled if the status is success. |
partner_fee | Number | Amount of fee that will be received by partner |
product_code | String | Product Identifier |
sales_price | Number | Bill amount that user needs to pay. Sales_price includes admin fee. |
status | String | Current state of order request, please refer to Order Status Reference |
error_code | String | Code that represents the error state |
error_message | String | Error description |
fulfillment_result | Array | Bill success information that can be used to generate the user receipt (proof of successful transaction) |
admin_fee | Number | Amount that charge to user as transaction fee |
client_name | String | Customer name in bill payment product |
client_number | String | Customer number in bill payment product |
meter_id | String | Id meter in PLN Postpaid product |
Order List
Order list will contains order history data
Field | Value |
---|---|
Endpoint | /v2/order?page=xx&limit=yy |
HTTP Method | GET |
Response |
|
Order List Response Description
Property | Data Format | Description |
---|---|---|
type | String | |
id | String | Identifier for order request, generated by user |
attributes | Object | Object Wrapper for response data |
client_number | String | Number inputted by end user |
error_code | String | Code that represents the error state |
error_message | String | Error description |
fields | Array | Fields contain extra parameters for specific products. Fields are part of client_number parameters for some products that need more than 1 client number parameter to pay the bill. |
fulfilled_at | Datetime | Time when order changed to final status with format RFC3339. Value will be filled if the status is success. |
partner_fee | Number | Amount of fee that will be received by partner |
product_code | String | Product Identifier |
sales_price | Number | Bill amount that user needs to pay. Sales_price includes admin fee. |
status | String | Current state of order request, please refer to Order Status Reference |
Account Balance
Account will be used for get current saldo can be used for transaction
Field | Value |
---|---|
Endpoint | /v2/account |
HTTP Method | GET |
Response |
|
Account Balance Response Description
Property | Data Format | Description |
---|---|---|
type | String | |
attributes | Object | Object Wrapper for response data |
saldo | Number | Current Balance can be used for transaction |
Order Status
All order status is defined by system, The below ones are used in this API.
Order Status | Description |
---|---|
Pending | Order accepted and waiting to progress |
Success | Order has been completed |
Failed | Order has been failed |
Error Response
If there is something wrong within the process, we generalize error response with this format
Field | Value |
---|---|
Http Code | 500 or 400 |
Response |
|
Response Description
Property | Data Format | Description |
---|---|---|
code | String | Error Message code Identifier |
status | String | Http Status |
detail | String | Error message details |
Error Code List
Error code will be shown on the order detail API response for failed transaction status.
Http Code | Error Code | Description | Error Case Possibilities |
---|---|---|---|
500 | S00 | Internal Server Error | Internal Tokopedia system error |
500 | S01 | Inquiry Pending. Please try again later | Inquiry is still on process due to delay from the biller |
500 | S02 | Product is not available | Product is deactivated intentionally in Internal Tokopedia system |
500 | S03 | Custom error message from Aggregator | Unmapped error from the biller / supplier |
500 | S04 | Product is temporarily unavailable | Product is temporarily on issue from the supplier as Tokopedia detected high failure rate for the product |
500 | S05 | Biller error. Please try again later | Biller is on issue |
500 | S06 | Auto failed by system due to biller or operator is not responding | More than 1 x 24 hour pending, will do auto failed by Tokopedia system |
500 | S07 | Internal Server Error. Please re-tap the card | EMoney Update balance error due to Tokopedia or biller error |
500 | S08 | General Card Error | EMoney Update balance general error (usually due to error that is unidentified) |
500 | S09 | Out of stock. Please try again later. We will try to find you another source | |
500 | S10 | Biller timeout. Please try again later. | |
400 | P01 | Invalid Request Payload | Your request payload structure to Tokopedia is invalid |
400 | P02 | Transaction is not found | When hitting order detail, the request_id is not found |
400 | P03 | Duplicate Request ID, please check your system | You have requested a same request_id previously |
400 | P04 | Product not found, please check your product code | The product code requested to Tokopedia system is wrong / does not exist |
400 | P05 | Product price mismatch, please follow agreed price | The amount from Inquiry and checkout is different |
400 | P06 | Insufficient balance, please top-up first or contact SATRIAN Business representative | For deposit type clients. If Client is using settlement, this error code will not be shown unless it is Tokopedia’s fault |
400 | P07 | Request ID cannot be null/empty and not allowed a white spaces or symbols | Invalid request_id , may contain invalid character like whitespace, symbol, or null |
400 | P08 | Invalid or Expired Token | Your token has expired. You need to re-request/refresh the token |
400 | P09 | Interval limit reached | This is applied to some products. Which has limitations of the order rule. E.g: You cannot buy Pulsa 10k-simpati with the same number and same product within 5 minutes |
400 | P10 | Invalid signature | Your digital signature at the request header is invalid |
400 | P11 | Product is not inquiry | You do inquiry process for non-inquiry product |
400 | P12 | Invalid Downline ID | |
400 | P13 | Invalid status. Allowed status are 1 or 0 | For BPJS KS, if the status thrown is not 1 or 0 |
400 | P14 | Some fields are missing. Please check your request | The required fields are incomplete |
400 | P15 | Invalid fields value. Please check your request | For BPJS KS, if the fields value is invalid |
400 | P16 | Invalid subscription day. Allowed value is between 1 - 28 | For BPJS KS, if the subscription_day is not between 1 - 28 |
400 | P19 | Promo no longer available | For Promo feature, if the promo has been ended or not yet started due to Quota / Period rule |
400 | P21 | Invalid card data Card Info Too Short. Please check your request | EMoney update balance - card data sent to Tokopedia is invalid. Check your system |
400 | P22 | Invalid inquiry id. Please check your system | EMoney update balance - inquiry id sent to Tokopedia is invalid. Check your system |
400 | P23 | Invalid card data: Invalid Hex. Please check your request | EMoney update balance - invalid hex sent to Tokopedia. Check your system |
400 | P24 | Invalid card data: Required Field Empty. Please check your request | EMoney update balance - missing field sent to Tokopedia found. Check your system |
400 | P25 | Invalid card data: Invalid Payload. Please check your request | EMoney update balance - payload sent to Tokopedia is invalid. Check your system |
400 | P26 | Void not allowed | EMoney Void request - the selected product is not allowed to do void request |
400 | P27 | Your request has reached limit, please try again later | |
400 | P28 | User is ineligible to buy the product | Client number checkout with ineligible MCCM Products |
400 | U00 | User Fault | General user error. E.g: Postpaid number but try to do prepaid top up, etc |
400 | U01 | Bill already paid | User try to paid for a bill that already been paid before |
400 | U02 | No Bill | Bill number not found |
400 | U03 | Nomor yang Anda masukkan tidak valid | Invalid Phone Number, Phone Number expired, Phone number blocked by operator, etc. |
400 | U04 | Unregistered user | BPJS KS if the user hasn’t been registered yet for Autodebit |
400 | U05 | Deactivated user. Please update the customer data | Deactivated user for BPJS KS autodebit |
400 | U06 | User Fault. The user has already been registered | BPJS KS response if the user has already been registered for autodebit |
400 | U07 | User Fault. Unsupported Card Issuer. Please check your card | EMoney update balance - the card used to update balance is not support / invalid |
400 | U08 | User Fault. NFC does not supported. Please update on the ATM | EMoney update balance - the NFC does not supported. Advise user to update balance on the ATM |
400 | U09 | Failed by Void request from User | EMoney Void request successfully voided. Hence the product status changed from success to failed |
400 | U10 | Customer number is blocked by the biller / operator. Please advise customer to reach the operator | Customer number is blocked by the operator |
400 | U11 | MSISDN Expired | Customer number is expired |
400 | U12 | User has reached the maximum limit of transactions. Please try again later | Customer number reached maximum limit of transactions. E.g: KwH over Limit for PLN Prepaid, Data Package exceeding maximum policy, etc. |
400 | U13 | Exceed maximum void duration policy | EMoney Void request has reached the maximum void max time policy |
400 | U14 | User Fault. Invalid period of payment | Invalid period for PBB payment. |
400 | U15 | User Fault. Invalid amount of payment | Invalid amount of CC payment. |
400 | U16 | Invalid Card Number | EMoney card number is invalid |
400 | U17 | Gen1 card is not eligible for online top up | EMoney (specifically for BCA Flazz) gen1 card |
Based on the prefix on error codes, we can classify 3 kinds of error:
- Prefix S (SXX) is an error for server fault or biller fault in SATRIAN.
- Prefix P (PXX) is an error for partner fault. For this error, the partner needs to check the request sent to SATRIAN. There might be something wrong with the request.
- Prefix U (UXX) is an error for the end user (customer) fault.
Note:
Error code in this document is still subject to change. If there’s additional error code or change in the code, SATRIAN representative will inform the part.Error Code Action Map
Error Code | Inquiry | Checkout | Order Detail / Callback |
---|---|---|---|
S00 | Retry | Pending | Retry |
S01 | Retry | Not Applicable | Not Applicable |
S02 | Failed | Failed | Failed |
S03 | Failed | Not Applicable | Failed |
S04 | Failed | Failed | Failed |
S05 | Failed | Not Applicable | Failed |
S06 | Not Applicable | Not Applicable | Failed |
S07 | Retry | Not Applicable | Not Applicable |
S08 | Retry | Not Applicable | Not Applicable |
S09 | Not Applicable | Not Applicable | Failed |
P01 | Failed | Failed | Not Applicable |
P02 | Not Applicable | Not Applicable | Failed |
P03 | Not Applicable | Failed | Not Applicable |
P04 | Failed | Failed | Not Applicable |
P05 | Not Applicable | Failed | Failed |
P06 | Not Applicable | Retry | Failed |
P07 | Not Applicable | Failed | Not Applicable |
P08 | Retry | Retry | Retry |
P09 | Not Applicable | Retry | Failed |
P10 | Not Applicable | Failed | Not Applicable |
P11 | Failed | Not Applicable | Not Applicable |
P12 | Not Applicable | Failed | Not Applicable |
P13 | Not Applicable | Not Applicable | Not Applicable |
P14 | Not Applicable | Not Applicable | Not Applicable |
P15 | Not Applicable | Not Applicable | Not Applicable |
P16 | Not Applicable | Not Applicable | Not Applicable |
P19 | Not Applicable | Failed | Failed |
P21 | Not Applicable | Not Applicable | Not Applicable |
P22 | Not Applicable | Not Applicable | Not Applicable |
P23 | Not Applicable | Not Applicable | Not Applicable |
P24 | Not Applicable | Not Applicable | Not Applicable |
P25 | Not Applicable | Not Applicable | Not Applicable |
P26 | Not Applicable | Not Applicable | Not Applicable |
P27 | Retry | Not Applicable | Retry |
P28 | Not Applicable | Retry with eligible promo product | Not Applicable |
U00 | Failed | Failed | Failed |
U01 | Failed | Failed | Failed |
U02 | Failed | Failed | Failed |
U03 | Failed | Failed | Failed |
U04 | Not Applicable | Not Applicable | Not Applicable |
U05 | Not Applicable | Not Applicable | Not Applicable |
U06 | Not Applicable | Not Applicable | Not Applicable |
U07 | Not Applicable | Not Applicable | Not Applicable |
U08 | Not Applicable | Not Applicable | Not Applicable |
U09 | Not Applicable | Not Applicable | Failed |
U10 | Failed | Failed | Failed |
U11 | Failed | Failed | Failed |
U12 | Failed | Failed | Failed |
U13 | Not Applicable | Not Applicable | Not Applicable |
Unmap Error Code | Failed | Pending | Pending |
Callback for Partner
For partners that need the callback mechanism from SATRIAN, follow these callback requirements below:
- Your service should be using SSL (HTTPS)
- Your service should whitelist our IP (52.74.35.225/32) to hit your service
- Your service should allow method POST
- Your service should allow Content-type application/vnd.api+json
We are generating a signature when doing a callback request to your API at the request header for security purposes. Client must validate the signature before processing the callback. See point 2.4.4 for example to verify the signature from SATRIAN Callback.
Order Callback
This callback is to notify the order status after the order has been processed, you can setup the URL through your Developer Console (order_notification).
Please be noted:
- Callback might arrive more than one time for the same order
- Implementing the check order status is mandatory even though the order callback mechanism has been implemented.
Please ensure your system handles the idempotency case of Tokopedia’s callback. As there is a possibility of Tokopedia giving multiple callbacks for 1 same order.
Callback default request body example:
{"data":{"type":"order","id":"1231231","attributes":{"admin_fee":0,"client_name":"User","client_number":"102111106111","error_code":"","error_detail":"","fields":null,"fulfilled_at":"2020-12-09T10:48:45Z","fulfillment_result":[],"partner_fee":0,"product_code":"pln-prepaid-token-100k","sales_price":102500,"serial_number":"5196 1584 0828 2085 4701","status":"Success","voucher_code":"5196 1584 0828 2085 4701"}}}
Product callback description
Property | Description |
---|---|
id | Product code |
is_inquiry | Mark if the product needs to do inquiry or not |
price_from | Previous (original) product price |
price_to | Updated (real-time) product price |
product_name | Product name |
status_from | Previous (original) product status Status: 1 = Active; 2 = Inactive; 3 = Temporarily Inactive |
status_to | Updated (real-time) product status Status: 1 = Active; 2 = Inactive; 3 = Temporarily Inactive |
updated_at | Time when the update occurred |
reference_id | Each request will contain our reference id and will also be unique |
Other Endpoints
MCCM
Flow:
The flow of Request Token(1-2), Checkout - Order Detail (5 - 8) will be the same as other regular products: Request Token, Checkout, Order Detail, Callback.Example of MCCM features in Tokopedia Main Apps:
Get MCCM Products
Get MCCM Products is the endpoint to get special product offers for specific users based on client number
Field | Value |
---|---|
Endpoint | /v2/promotion-product?client_number=087810114111 |
Http Method | GET |
Response Payload |
|
Response Field Description
Property | Data Format | Description |
---|---|---|
data | Array of Object | Will return the list of MCCM products offered |
type | String | API Type. Will always return "product" |
id | String | Product Code that will be used to do checkout |
attributes | Object | Object Wrapper for response data |
client_number | String | Client number of the customer. E.g: For Telco, use phone number |
is_inquiry | Boolean | Flag the product needs to do re-inquiry or not. If false, hit checkout endpoint directly. If true, hit inquiry endpoint first before checkout. All MCCM products don't need re-inquiry, hence always false |
price | Integer | Sales Price of the product to Customer. Note: The value interpretation could be different according to the business arrangement |
product_name | String | Name of the product offered to the customer |
Credit Card
Credit card is using PCIDSS environment, client need to comply with PCIDSS standard. Credit card products have an obligation to do these 2 methods(endpoint) before making an inquiry and checkout which is on PCIDSS environment. The first method is to GET one time URL. the method purpose is to to get OTU. OTU will be used to get token. after getting the OTU, we do the POST method with the client data request number cc. The response is token and expired date. the token which will then be used for inquiry and checkout, instead of client_number. Before integration start, please make sure you have filled in SAQ-A-EP (feel free to contact SAT team for more detail).
Flow:
Additional PCI DSS Service
Environment | Base URL | Description |
---|---|---|
Playground | https://b2b-playground.tokopedia.com/api | Testing / Development Env |
Production | https://pay.tokopedia.id/digital-b2b/api | Real / Production Env |
One Time URL
To get token for inquiry and checkout, it is required to get one time URL(OTU). The one time URL(OTU) from response will needed to get a token. The endpoint will be secured using OAuth.
Field | Value |
---|---|
Endpoint | {{base_url_pcidss}}/v2/credit-card/otu |
HTTP Method | GET |
Response Payload |
|
Response Field Description
Property | Data Format | Description |
---|---|---|
type | String | API Type. Will always return “otu” |
attributes | Object | Object Wrapper for response data |
url | String | One time url to get token |
Get Token
Before doing any inquiry and order a credit card bill, it is required to create a token from a plain credit card number. To get a token, we need to use the url that we get after hit “credit-card/otu” endpoint.
Field | Value |
---|---|
Endpoint | {{base_url_pcidss}}/v2/credit-card/token?token?auth_type=onetime&token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
HTTP Method | POST |
Request Payload |
|
Response Payload |
|
Request Field Description
Property | Data Format | Description |
---|---|---|
type | String | API Type. Will always return “token” |
attributes | Object | Object Wrapper for response data |
expired_in | int | Expiry time in seconds |
token | String | Access token that will be used for inquiry and order |
Sandbox Dummy Request Response
Request | Response | Description |
---|---|---|
GET {{base_url_pcidss}}/v2/credit-card/otu | Response payload:
| Get a one time url. This will help to convert plain credit card number to tokenize version |
GET {{base_url_pcidss}}/v2/credit-card/token?auth_type=onetime&token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Request payload:
| Response payload:
| Dummy Request & Response which returns token and expired_in from client_number |
POST {{base_url}}/v2/inquiry Request payload:
| Response payload:
| Inquiry request and response inside sandbox |
POST {{base_url}}/v2/order Request payload:
| Response payload:
| Submit order request and response inside sandbox |
GET /v2/order/testordercchm4 | Response payload:
| Get order detail request and response inside sandbox |