GoBiz API Reference
Gojek serves all of its merchants through GoBiz Platform. It is an all-in-one business solution that enables connectivity, digital payments, and other financial services for small and individual merchants. GoBiz helps you grow your business by making it easy to record orders, providing various types of payments, and bringing in customers. To enhance the experiences of its merchants, GoBiz also provides a platform for our partners to integrate with. GoBiz currently supports two types of integration, Direct Integration and Facilitator.
Integration Type | Description |
---|---|
Direct Integration | You’re a GoBiz merchant and you want to access Gojek features directly from your own system. |
Facilitator | You’re a facilitator. Either you a POS provider or an online order aggregator and you want to enable features to your merchants. |
Scroll down for code samples, example requests, and responses.
HTTP(S) API
You can communicate with GoBiz API by sending HTTP(S) request. The request consists of Base URL and HTTP(S) Header. The Base URL specifies the resource to which the request is applied. The HTTP(S) Header carries the data type of the request, data type of the response, and the authentication information. GoBiz then sends a response back in JSON format.
Base & GoAuth URLs
In the Sandbox Environment, the partner can perform internal end-to-end testing using the GoAuth Staging credentials.
Once the testing is completed successfully, the GoBiz service can be fully utilized in the Production Environment using the GoAuth Production credentials. The URLs for Sandbox and Production environments are given below.
Sandbox Environment
BASE_URL: https://api.partner-sandbox.gobiz.co.id/
OAUTH_URL: https://integration-goauth.gojekapi.com
curl -X POST https://api.partner-sandbox.gobiz.co.id/
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}'
Production Environment
BASE_URL: https://api.gobiz.co.id/
OAUTH_URL: https://accounts.go-jek.com
curl -X POST https://api.gobiz.co.id/
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}'
HTTP(S) Header
An HTTP Header is used in an HTTP request to provide information about the request. The HTTP Header for GoBiz API requests carries the information described in the table below.
Header | Description | Value | Type | Required |
---|---|---|---|---|
Content-Type | The Content-Type field indicates the JSON type that is acceptable to send to the recipient. | application/json | String | Required |
Authorization | The Authorization field creates the JSON Web Token (JWT) to send to the recipient when authentication is successful. Note: For Direct integration authentication, refer Direct Integration Client Credentials and for facilitator authentication, refer Facilitator Authentication. | Bearer {access-token} | String | Required |
Responses
GoBiz uses conventional HTTP status response codes to indicate the success or failure of an API request. The response codes used in GoBiz are given below.
- Success codes
- Error codes
- Server error codes
Success Codes
Status codes in the 2xx range indicate success. Different success codes in the 2xx range are returned based on what the request attempts to do.
Error Codes
Status codes in the 4xx range indicate an error. The error codes are returned when the information provided by the client is incorrect or incomplete (for example, incorrect format, omission of a required parameter, invalid information, and so on). Certain 4xx errors can be handled programmatically.
Server Error Codes
Status codes in the 5xx range indicate a server error. The server error codes are returned when the GoBiz server does not work as expected.
Response Format
The HTTP response consists of three fields given below.
- success
- data
- errors
success
represents the success status of the request.
data
returns the values in the response.
errors
returns the error message title and the error message for a request.
Success Response
The field success
is set to true when data (if any) is returned.
JSON Attribute | Description | Type |
---|---|---|
success | It should always be set to true. Request is successful and data, if any, is returned. | Boolean |
data | The object acts as a wrapper for any data returned by the API call. | Object |
{
"success": true,
"data": {
"key": "value"
}
}
Error Response
The field success
is set to false when data (if any) is not returned and represents that a problem has occurred.
The root cause can be either of the following:
- A problem with the submitted data or unsatisfied API Call pre-conditions
- An error in the processing of request
JSON Attribute | Description | Type |
---|---|---|
success | It should always be set to false. Request is unsuccessful and data (if any) is not returned. | Boolean |
errors | The array acts as a wrapper for the error objects returned by the API call. | Array (Object) |
» message_title | It is the short description of the HTTP error. | String |
» message | It describes the cause of the HTTP error. | String |
{
"success": false,
"errors": [
{
"message_title": "Error hint",
"message": "Start date must be after today."
}
]
}
HTTP Status Code Summary
Status codes used by GoBiz APIs are categorized into 2xx, 4xx, and 5xx.
Code 2xx
Status | Description |
---|---|
200 - OK | It indicates that the request is successful. |
201 - Created | It indicates that the request is successful and the resource is created. |
Code 4xx
Status | Description |
---|---|
400 - Bad Request | It indicates that the request cannot be processed due to an error (for example, incorrect parameters). |
401 - Unauthorized | It indicates that the request contains invalid access token. |
403 - Forbidden | It indicates that the access token does not have the permission to access the resource. |
404 - Not Found | It indicates that the requested resource does not exist. |
409 - Conflict | It indicates that the request cannot be completed due to a conflict with the current state of resource or another request. |
415 - Unsupported Media Type | It indicates that the request does not contain the correct versioning. |
422 - Unprocessable Entity | It indicates that the request contains correct syntax but the contents are incorrect. |
Code 5xx
Status | Description |
---|---|
50x - GoBiz Server Error | It indicates a problem at the GoBiz server and the server is unable to process any request. |
Error Glossary
The errors and errors responses common to all the endpoints are described in the table given below.
The sample error response code for each error is given at the side, in the code section.
Error | Description | Type | Notes |
---|---|---|---|
UnsupportedAcceptType | Invalid versioning header in the request. Refer Errors Response. | String | For errors object, refer Errors 404/406/415. |
UnregisteredOutlet | Invalid versioning header in the request. Refer Errors Response. | String | For errors object, refer Errors 404/406/415). |
Unauthorized | The outlet is not yet registered in the Partner Integration system. Please contact the support team. Refer Errors Response. | String | For errors object, refer Errors 401 - Unauthorized. |
Errors Response
JSON Attribute | Description | Type |
---|---|---|
success | Status of the request. Value false indicates an error. | Boolean |
errors | Details of the error. | Array(Object) |
{
"success": false,
"errors": [
{
"message_title": "UnsupportedAcceptType",
"message": "Invalid Accept header: application/vnd.eim.v0+json"
}
]
}
{
"success": false,
"errors": [
{
"message_title": "Requested resource not found",
"message": "The outlet is not yet registered for integration. Please contact the support team."
}
]
}
{
"success": false,
"errors": [
{
"code": "HTTP_401",
"message": "Your session is expired. Please login again.",
"message_title": "Session Expired",
"message_severity": "error"
}
]
}