dokumentasi integrasi backend midtrans

Endpoint

HTTP Method: POST

Production: https://app.midtrans.com/snap/v1/transactions

Sandbox: https://app.sandbox.midtrans.com/snap/v1/transactions

Request Headers

SERVER_KEY = "VT-server-Cpo03kYDOc0cNUKgt6hnLkKg"

AUTH_STRING = Base64("VT-server-Cpo03kYDOc0cNUKgt6hnLkKg:")

AUTH_STRING = "VlQtc2VydmVyLUNwbzAza1lET2MwY05VS2d0NmhuTGtLZzo="

To create valid Snap HTTP request, merchant have to add 3 headers:

  • Accept: application/json
  • Content-Type: application/json
  • Authorization: Basic AUTH_STRING

Snap validates HTTP request by using Basic Authentication method. The username is your SERVER_KEY while the password is empty. You can see your SERVER-KEY on Settings - Access Keys.

Authorization header value is represented by AUTH_STRING. AUTH_STRING is base-64 encoded string of your username & password.

AUTH_STRING = Base64(SERVER_KEY + :)

Sample Request : 

{
  "transaction_details": {
    "order_id": "ORDER-101",
    "gross_amount": 10000
  },
  "item_details": [{
    "id": "ITEM1",
    "price": 10000,
    "quantity": 1,
    "name": "Midtrans Bear",
    "brand": "Midtrans",
    "category": "Toys",
    "merchant_name": "Midtrans"
  }],
} 

 

 

1 Komentar untuk "dokumentasi integrasi backend midtrans"

  1. ditunggu tutorial youtubenya tentang midtarns ini mas. hehe

    BalasHapus

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel