Skip to main content

Request

smilepayz teamsAbout 3 min



Tips

Welcome to the smilepayz Pay API documentation page. Integrate this API to start transacting using smilepayz on your
site.
smilepayz API is a third party API that functions as a payment gateway system . smilepayz API helps you in terms of
receiving online payments from your customers. With just one smilepayz API, you can accept payments from a variety of
available payment methods.

Tips

smilepayz API is a restful Web service, which enables programmatic communication between you and smilepayz payment
system. You can easily integrate to any of your internet-capable system (Web, App, PoS, IoT, etc.) and can fully build &
customize the payment UI, on your side without smilepayz hosted payment UI. smilepayz Core API is suitable for medium
size as well as large size businesses.

HTTP Request



Header Format Structure Components – payin

Service Code90
NameAPI transaction pay in
Version1.0
HTTP MethodPOST
Path.../{version}/transaction/pay-in

Header Parameters



API Header Format Structure for Transaction PayIn:

AreaFieldAttributeTypeDescription
HeaderContent-TypeMandatoryStringString represents indicate the media type of the resource (e.g. application/json, application/pdf)
AuthorizationMandatoryStringString starts with keyword “Bearer ” followed by access_token (e.g. Bearer eyJraWQiOi...Jzc29zIiiY)
X-TIMESTAMPMandatoryStringMerchant's current local time in yyyy-MM-ddTHH:mm:ssTZD format
X-SIGNATUREMandatoryStringRepresents signature of a request.Identify Signature Type used
ORIGINOptionalStringOrigin Domain www.yourdomain.comopen in new window
X-PARTNER-IDMandatoryStringMerchant_ID. Unique ID for a partner as merchant_id
X-EXTERNAL- IDMandatoryStringNumeric String. Reference number that should be unique in the same day
CHANNEL-IDMandatoryStringFixed value: 95221

Notes: X-SIGNATURE

  1. HMAC_SHA512 (merchantSecret, stringToSign) with formula stringToSign = HTTPMethod +”:“+ EndpointUrl +":"+
    AccessToken +":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ ":“ + TimeStamp
  2. Complete URL endpoint including all parameters in related URL (Relative path, example: Path in general information
    of each API service)
  3. For the minify(Request Body) parameter, in case there is no Request Body then an empty string is used.
  4. The signature string is generated from string to sign above with applying HMAC_SHA512 hashing using secret key which
    given by smilepayz, and then encode the result to base64.
  5. Put the signature string into HTTP header “ X-SIGNATURE“ when call smilepayz’s API.
  6. which merchantSecret you can find this page.Please note that the sandbox env is different from the production env.

Tips

Example Header – Transaction Request:


Content-type: application/json
Authorization: Bearer gp9HjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9a"
X-TIMESTAMP: 2020-12-17T10:55:00+07:00
X-SIGNATURE: 7MHd9v5/m9JeqmDZVwWBZUZ5J5...7120QnFEny7Qm7uQR1G0TWCh10fsU6nVxiRoeoQ==
ORIGIN: www.hostname.com
X-PARTNER-ID: 20001
X-EXTERNAL-ID: 41807553358950093184162180797837
CHANNEL-ID: 95221

Body Parameters



AreaFieldAttributeTypeDescription
BodyorderNoMandatoryString(32)String transaction Unique ID.
purposeMandatoryString(64)String The reason to transaction
productDetailOptionalString(128)String The subject matter of this transaction
additionalParamConditionalObjectObject TradeAdditionalReq Refer to Data AdditionalReq
itemDetailListOptionalList(ItemDetail)Object The products for this transaction. Refer to Data ItemDetail
billingAddressOptionalAddressObject Address for billing. Refer to Data BillingAddress
shippingAddressOptionalAddressObject Address for shipping,Refer to Data ShippingAddress
moneyMandatoryMoneyObject Net amount of the transaction. Refer to Data Money
redirectUrlOptionalString(256)Redirect to customer url
merchantMandatoryMerchantObject merchant information. Refer to Data Merchant
paymentMethodOptionalStringString Payment option which shows the provider of this payment. Refer to Data PaymentMethod
payerOptionalPayerObject Transaction initiator. Refer to Data Payer
receiverOptionalReceiverObject Trading beneficiaries. Refer to Data Receiver
expiryPeriodOptionalNumberValidity period of payment link (in seconds) Example: 3600
areaConditionalIntegerArea code Which region's api are you requesting? if null the default value is 10 that belongs to INDONESIA, Others refer to Data Area

Tips

Example Body – Transaction Request:


POST .../v1.0/transaction/pay-in HTTP/1.2

Content-type: application/json
Authorization: Bearer gp9HjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9a"
X-TIMESTAMP: 2020-12-17T10:55:00+07:00
X-SIGNATURE: 7MHd9v5/m9JeqmDZVwWBZUZ5J5...7120QnFEny7Qm7uQR1G0TWCh10fsU6nVxiRoeoQ==
ORIGIN: www.hostname.com
X-PARTNER-ID: 20001
X-EXTERNAL-ID: 41807553358950093184162180797837
CHANNEL-ID: 95221

{
  "orderNo": "2020102900000000000001",
  "purpose": "transaction for business bla bla",
  "productDetail": "electronics. Apple",
  "additionalParam": {},
  "paymentMethod": "BRI",
  "money": {
    "currency": "IDR",
    "amount": 10000
  },
  "itemDetailList": [
    {
      "name": "Apple Mac",
      "quantity": 1,
      "price": 10000
    }
  ],
  "billingAddress": {
    "countryCode": "Indonesia",
    "city": "Djakarta",
    "address": "djakarta #1002873",
    "postalCode": "10045",
    "phone": "62895359978010"
  },
  "shippingAddress": {
    "countryCode": "Indonesia",
    "city": "Djakarta",
    "address": "djakarta #1002873",
    "postalCode": "10045",
    "phone": "62895359978010"
  },
  "merchant": {
    "merchantId": "20001",
    "merchantName": "Betty",
    "accountNo": "22102014422"
  },
  "payer": {
    "name": "Betty",
    "email": "[email protected]",
    "phone": "62895359978010"
  },
  "receiver": {
    "name": "Vincent.CH",
    "phone": "62895359978010",
    "email": "[email protected]"
  },
  "expiryPeriod": 3600,
  "area": "10"
}
Last update: