Skip to content

API Access Token B2B

API Information

FieldValue
Path/api/{version}/access-token/b2b
HTTP MethodPOST
Service Code73
Versionv1.0
Type FormatJSON

To access all Senmo APIs, OAuth 2.0 is used as the Authorization and Authentication framework. You need to request an access token by calling the URL above with:

  • Request Body/Payload: grantType=client_credentials
  • Request Header: filled with a formulated Signature derived from your privateKey, along with X-TIMESTAMP and clientID.

Request Structure

Request Header

Details
FieldTypeMandatoryDescription
X-TIMESTAMPStringMMust follow ISO 8601 format. e.g.: 2020-01-01T04:10:00+07:00
X-CLIENT-KEYStringMClient ID given by iFortepay, sent after registration is complete
X-SIGNATUREStringMRequest signature using Asymmetric Signature mechanism: SHA256withRSA(Private_Key, stringToSign). `stringToSign = clientID + "
Content-TypeStringMFill with: application/json
ORIGINStringOOrigin domain registered on the iFortepay system

M = Mandatory, O = Optional

Request Body

Details
FieldTypeMandatoryDescription
grantTypeStringMFill with: client_credentials

Example Request

Details
artifact
id: access-token-request
name: Example Request - API Access Token B2B
type: code.bash
content: |-
  curl --location 'https://api-stage.senmo.id/api/v1.0/access-token/b2b' \
  --header 'Content-Type: application/json' \
  --header 'X-TIMESTAMP: 2022-11-14T15:00:00+07:00' \
  --header 'X-CLIENT-KEY: MCPD00000006' \
  --header 'X-SIGNATURE: F6wcrU1TSZAfB3qsDBsGGpE/0B5C4CXWmosja0OIT875C3ABzYiFOnQwS62pIT/bV+2Rsr5f7gL2UdE9H5yxd7rhaJo14YCZO/LJmvL9NwrZM8JwLFGayiB64Sy37FBy4cachg0AGT6ELIiCW9j0E7A4DdE4eDons8+Yk6WFGKdHaxkcokHbGI9bHb4S+WZ/W9MqQI1K8pdGoFQ91zifqT/+Vjj2YRz2KR1taua59+Lk2jMJe7q/58yFJBdFdG/oD1WpNMQztkM9TcLb2/rd1h7YiVdmky3BFc5+Qq3kkYltTnZsUPPecqIaY0EqhPOFDbHj8ygH36njXUwZwSpMEw==' \
  --header 'origin: https://www.finalunion.co.id' \
  --data '{
    "grantType": "client_credentials"
  }'

Response Structure

Response Header

Details
FieldTypeMandatoryDescription
Content-TypeStringMValue: application/json
X-TIMESTAMPStringMTime at iFortepay Server in ISO 8601 format

Response Body

Details
FieldTypeMandatoryDescription
responseCodeStringMResponse code
responseMessageStringMResponse message
accessTokenStringMAuthorization token issued to the client, used to access iFortepay APIs
tokenTypeStringMToken type — iFortepay uses "Bearer"
expiresInStringMSession expiry in seconds: 900 seconds (15 minutes)

Example Response

Details

✅ Success Response

json
{
  "responseCode": "2007300",
  "responseMessage": "Successful",
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "tokenType": "Bearer",
  "expiredIn": "900"
}

❌ Failed Response

json
{
  "responseCode": "4007300",
  "responseMessage": "Bad Request - X-TIMESTAMP is Required"
}

iFortepay API Documentation