Skip to main content

OVO Recurring


Requirements

  1. Client ID / Secret Key from OVO
  2. DOKU account. To access DOKU API, you need DOKU client id & DOKU client key that you can find in DOKU back office.

Integration Flow

Here is the overview flow for OVO Recurring :

Direct API - OVO Recurring Sequence Diagram
DOKU OVO Recurring Merchant Flow

API list

Here is the sample of request header to implement every API list below :

Client-Id: MCH-0001-10791114622547
Request-Id: 15022aab-444f-4b04-afa8-ddfce89432ec
Request-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=vl9DBTX5KhEiXmnpOD0TSm8PYQknuHPdyHSTSc3W6Ps=
Request Header Explanation
ParameterDescription
Client-IdClient ID retrieved from DOKU Back Office
Request-IdUnique random string (max 128 characters) generated from merchant side to protect duplicate request
Request-TimestampTimestamp request on UTC time in ISO8601 UTC+0 format. It means to proceed transaction on UTC+7 (WIB), merchant need to subtract time with 7. Ex: to proceed transaction on September 22th 2020 at 08:51:00 WIB, the timestamp should be 2020-09-22T01:51:00Z
SignatureSecurity parameter that needs to be generated on merchant Backend and placed to the header request to ensure that the request is coming from valid merchant. Please refer to this section to generate the signature

Merchant and DOKU must validate signature in API list, see how to generate signature. You can refer to Generate Signature.


Customer Binding

Merchant can binding OVO account to customer id, each OVO account can only binding to one customer on one merchant. Customer need to verify OTP and input PIN on OVO page.

API Request

TypeValue
HTTP MethodPOST
API endpoint (Sandbox)https://api-sandbox.doku.com/ovo-open-api/v1/token
API endpoint (Production)https://api.doku.com/ovo-open-api/v1/token

Here is the overview flow for OVO Recurring Customer Binding :

Direct API - OVO Recurring - Customer Binding Sequence Diagram
DOKU OVO Recurring - Customer Binding Flow

Here is the sample of request body to binding OVO account to customer id :

{
"customer": {
"id": "CUST_UAT_31",
"name": "QA Shifter OVO Recurring",
"phone": "087123123021",
"email": "cobacobacoba9999@gmail.com",
"additional_info": "None"
},
"ovo_account": {
"account_email": "cobacobacoba9999@gmail.com",
"account_mobile_phone": "6287123123021",
"success_registration_url": "https://sandbox.doku.com/bo/login",
"failed_registration_url": "https://www.seleniumeasy.com/test"
},
"service_type": "RECURRING"
}
Request Body Explanation
ParameterTypeMandatoryDescription
customer.idstring (50)MandatoryMerchant customer id
customer.namestring (70)OptionalCustomer name
customer.emailstring (255)OptionalCustomer email
customer.phonestring (20)OptionalCustomer phone number
customer.additional_infostring (20)OptionalCustomer additional info
ovo_account.account_mobile_phonestring (20)MandatoryRegister phone number on OVO
ovo_account.success_registration_urlstring (2048)MandatoryURL for direct page after success register
ovo_account.failed_registration_urlstring (2048)MandatoryURL for direct page after failed register
service_typestring (255)MandatoryService Type, please input RECURRING

API Response

After hitting the above API request, DOKU will give the response.

TypeValue
HTTP Status201
ResultSUCCESS

Here is the sample of response body:

{
"customer": {
"id": "CUSTOMER_OVOxDOKU",
"name": "TESTINGQA",
"email": "test@gmail.com",
"phone": "087872180555",
"additional_info": "None"
},
"ovo_account": {
"registration_url": "https://jokul.doku.com/ovo-open-api/registration/sessionId/27817263817263817263817",
"status": "PENDING",
}
}
Response Body Explanation
ParameterTypeMandatoryDescription
customer.idstring (50)MandatoryMerchant customer id
customer.namestring (70)OptionalCustomer name
customer.emailstring (255)OptionalCustomer email
customer.phonestring (20)OptionalCustomer phone number
customer.additional_infostring (20)OptionalCustomer additional info
ovo_account.account_mobile_phonestring (20)MandatoryRegister phone number on OVO
ovo_account.registration_urlstring (2048)MandatoryURL from DOKU for Customer to binding their account
ovo_account.statusstringMandatoryAlways PENDING for Successfull token request (waiting for OTP verification & PIN vervification)

Get List Token (OVO)

After successful account linkage, merchant can get OVO token that can be used for that customer to payment using OVO. Token is created by DOKU, and valid for 1 year.

API Request

TypeValue
HTTP MethodPOST
API endpoint (Sandbox)https://api-sandbox.doku.com/tokenization/v1/tokens
API endpoint (Production)https://api.doku.com/tokenization/v1/tokens

Here is the sample of request body to get Token for OVO :

{
"customer" : {
"id" : "CUST_UAT_31"
},
"token_data": {
"type": "WALLET_RECURRING"
}
}
Request Body Explanation
ParameterTypeMandatoryDescription
customer.idstring (50)MandatoryCustomer id that already have active token
token_data.typestringOptionalDIRECT_DEBIT / CREDIT_CARD / WALLET / WALLET_RECURRING, if not specified get all token

API Response

After hitting the above API request, DOKUwill give the response.

TypeValue
HTTP Status200
ResultSUCCESS
{
"customer": {
"id": "CUST_UAT_31",
"name": "QA Shifter OVO Recurring"
},
"token_data": {
"type": "WALLET_RECURRING"
},
"wallet": {
"issuer": "OVO",
"token_id": "c15d437b56b918abaa3951b0beb48a57",
"masked_phone_number": "****3021"
}
}
Response Body Explanation
ParameterTypeMandatoryDescription
customer.idstring (50)MandatoryMerchant customer id
customer.namestring (70)OptionalCustomer name
token_data.typestringMandatoryToken Type : CREDIT CARD, DIRECT DEBIT , WALLET, WALLET_RECURRING
wallet.issuerstring (255)MandatoryIssuer for wallet binding
wallet.token_idstring (128)MandatoryToken generated by DOKU
wallet.masked_phone_numberstring (8)MandatoryPhone number masked

Get Account Balance

This balance check API allows users to check their latest OVO balance. The user should be able to access their balance at any time so they can make accurate and up to date decision regarding their transactions.

API Request

TypeValue
HTTP MethodPOST
API endpoint (Sandbox)https://api-sandbox.doku.com/ovo-open-api/v1/balance
API endpoint (Production)https://api.doku.com/ovo-open-api/v1/balance

Here is the sample of request body to get balance for OVO :

{
"customer": {
"id": "1232131321"
},
"ovo_account": {
"token_id": "fc72c4b0aedff916ab92e39cb80d3111"
}
}
Request Body Explanation
ParameterTypeMandatoryDescription
customer.idstring (64)MandatoryCustomer id that already have active token
ovo_account.token_idstring (128)MandatoryToken generated by DOKU

API Response

After hitting the above API request, DOKUwill give the response.

TypeValue
HTTP Status201
ResultSUCCESS
{
"customer": {
"id": "1232131321",
"name": "Joko",
"email": "joko@gmail.com",
"phone": "081287458232",
"additional_info": ""
},
"ovo_account" : {
"ovo_cash_balance" : 100000,
"ovo_point_balance" : 100000
}
}
Response Body Explanation
ParameterTypeMandatoryDescription
customer.idstring (50)MandatoryMerchant customer id
customer.namestring (70)OptionalCustomer name
customer.emailstring (255)OptionalCustomer email
customer.phonestring (20)OptionalCustomer phone number
customer.additional_infostring (20)OptionalCustomer additional info
ovo_account.ovo_cash_balancenumber (10)MandatoryOVO Cash Balance
ovo_account.ovo_point_balancenumber (10)MandatoryOVO Point Balance

Payment Using Token

Payment using OVO token from OVO cash balance or/and OVO point balance. When OVO have program for payment using OVO point, customer can paying using OVO point balance on merchant. Payment using mixed OVO point and OVO cash, OVO point will be deducted first and the remaining will be deducted from OVO cash. Customer need to verify payment by input PIN on OVO page.

API Request

TypeValue
HTTP MethodPOST
API endpoint (Sandbox)https://api-sandbox.doku.com/ovo-open-api/v1/payment-recurring
API endpoint (Production)https://api.doku.com/ovo-open-api/v1/payment-recurring

Here is the overview flow for OVO Recurring Payment Flow :

Direct API - OVO Recurring - Payment Flow Sequence Diagram
DOKU OVO Recurring - Payment Flow

Here is the sample of request body to do payment using OVO Token :

{
"customer": {
"id": "CUST_UAT_31",
"name": "QA Shifter OVO Recurring",
"phone": "087123123021",
"email": "cobacobacoba9999@gmail.com",
"additional_info": "None"
},
"additional_info": {
},
"order": {
"invoice_number": "INVR_2021_7105",
"line_items": [
{
"name": "Netflix",
"price": 5000,
"quantity": 1
}
],
"amount": "100000"
},
"ovo_account": {
"token_id": "c15d437b56b918abaa3951b0beb48a57",
"payment_use_ovo_point": false,
"first_payment": false
}
}
Request Body Explanation
ParameterTypeMandatoryDescription
customer.idstring (50)MandatoryMerchant customer id
customer.namestring (70)OptionalCustomer name
customer.emailstring (255)OptionalCustomer email
customer.phonestring (20)OptionalCustomer phone number
customer.additional_infostring (255)OptionalCustomer additional info
additional_infoJsonOptionaladditional info
order.invoice_numberstring (32)MandatoryMerchant transaction id unique per client id, only accept alphanumeric, _ and - Min length is 3, max length is 32
order.line_items.namestringOptionalPrivacy concern so optional, but if send will help our risk engine
order.line_items.pricenumberOptionalPrivacy concern so optional, but if send will help our risk engine
order.line_items.quantitynumberMandatoryPrivacy concern so optional, but if send will help our risk engine
order.amountnumber (10)MandatoryConverted total amount.
ovo_account.token_idstring (128)MandatoryOVO E-Wallet Token
ovo_account.payment_use_ovo_pointstring (5)OptionalDefault false, if True will use all OVO Point first before use OVO Cash
ovo_account.first_paymentBooleanOptionalTrue. if this transaction is first payment of subcription

API Response

After hitting the above API request, DOKUwill give the response.

TypeValue
HTTP Status201
ResultSUCCESS
{
"customer": {
"id": "CUST_UAT_31",
"name": "QA Shifter OVO Recurring",
"email": "cobacobacoba9999@gmail.com",
"phone": "087123123021",
"additional_info": "None"
},
"additional_info": {},
"order": {
"invoice_number": "INVR_2021_7105",
"line_items": [
{
"name": "Netflix",
"price": 5000,
"quantity": 1
}
],
"amount": 100000
},
"payment": {
"status": "SUCCESS"
}
}
Response Body Explanation
ParameterTypeMandatoryDescription
customer.idstring (50)MandatoryMerchant customer id
customer.namestring (70)OptionalCustomer name
customer.emailstring (255)OptionalCustomer email
customer.phonestring (20)OptionalCustomer phone number
customer.additional_infostring (20)OptionalCustomer additional info
additional_infoJsonOptionaladditional info
order.invoice_numberstring (32)MandatoryMerchant transaction id unique per client id, only accept alphanumeric, _ and - Min length is 3, max length is 32
order.line_items.namestringOptionalPrivacy concern so optional, but if send will help our risk engine
order.line_items.pricenumberOptionalPrivacy concern so optional, but if send will help our risk engine
order.line_items.quantitynumberMandatoryPrivacy concern so optional, but if send will help our risk engine
order.amountnumber (10)MandatoryConverted total amount.
payment.statusstringMandatoryPENDING for successful token request (waiting for OTP verification) / SUCCESS if not need OTP, TOKEN_EXPIRED (need to input PIN twice and still can proceed to transaction)

Refund

Refund OVO transaction. For payment using mixed OVO cash and OVO point, OVO point will be refunded first.

API Request

TypeValue
HTTP MethodPOST
API endpoint (Sandbox)https://api-sandbox.doku.com/ovo-open-api/v1/payment-refund
API endpoint (Production)https://api.doku.com/ovo-open-api/v1/payment-refund

Here is the sample of request body to do refund for OVO Transaction :

{
"order": {
"invoice_number": "INV_NUMBER_D009"
},
"payment": {
"original_request_id":"82014"
},
"refund": {
"amount": 1000,
"reason":"Cancel Order"
}
}
Request Body Explanation
ParameterTypeMandatoryDescription
order.invoice_numberstring (32)MandatoryInvoice number of the transaction that being refunded, same as the request payment
payment.original_request_idstring (128)MandatoryRequest ID from Payment Initiation of the transaction that being refunded
refund.amountnumberMandatoryTransaction amount that wants to be refunded
refund.reasonstring (255)OptionalReason refund

API Response

After hitting the above API request, DOKUwill give the response.

TypeValue
HTTP Status201
ResultSUCCESS
{
"order": {
"invoice_number": "INV_NUMBER_D009"
},
"payment": {
"original_request_id": "82014"
},
"refund": {
"amount": 1000,
"reason": "Cancel Order",
"status": "SUCCESS",
"message": "SUCCESS"
}
}
Response Body Explanation
ParameterTypeMandatoryDescription
order.invoice_numberstring (32)MandatorySame as the request
payment.original_request_idstring (128)MandatorySame as the request
refund.amountnumberMandatoryAmount to be refunded
refund.reasonstring (255)OptionalReason refund
refund.statusstringMandatorySUCCESS / FAILED
refund.messagestring (10)OptionalReason if failed refund

Unbind Linked Account

Customer should always have option to unlink their OVO account from any merchant.

API Request

TypeValue
HTTP MethodPOST
API endpoint (Sandbox)https://api-sandbox.doku.com/ovo-open-api/v1/token-delete
API endpoint (Production)https://api.doku.com/ovo-open-api/v1/token-delete

Here is the sample of request body to unlink their OVO Account :

{
"customer": {
"id": "TEST-CIMBXDOKU-05",
"name":" "
},
"ovo_account": {
"token_id": "1614dc147e404f41f6d2de877fda1f94"
}
}
Request Body Explanation
ParameterTypeMandatoryDescription
customer.idstring (50)MandatoryMerchant id
customer.namestring (50)MandatoryMerchant name
ovo_account.token_idstring (128)MandatoryToken created from register ovo account that owned by this customer id

API Response

After hitting the above API request, DOKUwill give the response.

TypeValue
HTTP Status201
ResultSUCCESS
{
"customer": {
"id": "TEST-CIMBXDOKU-05",
"name": "DOKUXCIMB"
},
"ovo_account": {
"token_id": "1614dc147e404f41f6d2de877fda1f94",
"status": "SUCCESS",
"message": "Success Unbinding Ovo Account"
}
}
Response Body Explanation
ParameterTypeMandatoryDescription
customer.idstring (50)MandatoryMerchant id
customer.namestring (50)MandatoryMerchant name
ovo_account.token_idstring (128)MandatoryToken created from register ovo account that owned by this customer id
ovo_account.statusstringMandatoryDELETED Token
ovo_account.messagestringOptionalSUCCESS unbind token_id from customer