Skip to main content

Notification Message API

Overview​

 This API is to verify the JWT transaction token notified to the application when complete to payment the item.

How to Authorize​

To use this API, an access token which retrieve by the grant_type and scope described on the following table must be specified on the Authorization request header.

  • Authorization Type
    • Bearer
  • Supported grant_type
    • client_credentials_grant
  • The necessary scope
    • transactionToken:introspect

Endpoint URL​

Endpoint URL in each environment will be following.

itemdescription
HTTP MethodPOST
Request URIsandbox java https://sb-api.andapp.jp/1.0.0/payment/introspection production java https://api.andapp.jp/1.0.0/payment/introspection

Request header​

Request header is as follows.

namevaluerequireddescription
Content-Typeapplication/jsontrue 

Request body​

You can set the JSON string with the following parameters.

propertytitletyperequireddescription
transactionTokenTransaction tokenstringtrueThe JWT transaction token to notify to the application when complete to payment the item.

Request Example​

Request example is as follows.

POST /1.0.0/payment/introspection HTTP/1.1
Host: sb-api.andapp.jp:443
Content-Type: application/json
Authorization: Bearer {access_token}

{
"transactionToken": "eyj..."
}

Response Status​

The response status when succeeded is as follows.

statusdescription
200 OKIt will be returned if the Transaction Token is valid.

Response Header​

Response header is as follows.

namevaluerequireddescription
Content-Typeapplication/jsontrue 

Response Body​

The JSON string with the following parameters is sent. Please refer to the example below for details.

propertytitletyperequireddescription
issIssuer claimstringtrue

The URI that represents the issuer.

The following value is specified depending on each environment.

sandbox
https://sb-api.andapp.jp/1.0.0/payment
Production
https://api.andapp.jp/1.0.0/payment
subSubject claimstringtrue

The URI which represents the player who made the payment.

The following URI format (URI Template) is specified depending on each environment.

sandbox
https://sb-api.andapp.jp/1.0.0/users{/playerId}
Production
https://api.andapp.jp/1.0.0/users{/playerId}
audAudience claimstringtrue

Will URI representing the game of Client ID, which was carried out a payment request.

By the execution environment will be URI format (URI Template format) as follows.

sandbox
https://sb-api.andapp.jp/1.0.0/clients{/clientId}
Production
https://api.andapp.jp/1.0.0/clients{/clientId}
typToken typestringtrueFixed value: "transaction_token".
iatUNIX timestamp of the issue date and timeintegertrue

The UNIX timestamp when the transaction_token issued.

expUNIX time stamp of the expiration date and timeintegertrue

The UNIX timestamp which represents the date and time when the transaction_token is expired. The Transaction Token is invalid after the expiration date and time.

transactionTransaction objectobjecttrue

 

transaction.idTransaction IDintegertrueUp to 16 digits
transaction.productProduct objects that were purchasedobjecttrue 
transaction.clientIdClient ID that created the transaction objectintegertrueUp to 16 digits
transaction.userIdPlayer ID that created the transaction objectintegertrueUp to 16 digits
transaction.product.idID of product objectstringtrue 
transaction.product.clientIdClient ID that created the product objectintegertrueUp to 16 digits
transaction.product.typeProduct typestringtrueFixed value: "CONSUMABLE".
transaction.product.stateThe state of the productstringtrueFixed value: "AVAILABLE".
transaction.product.pricesCurrency by tax-inclusive price list of productsarraytrue 
transaction.product.prices[]Currency by tax-inclusive price object of the productobjecttrue 
transaction.product.prices[].valuepricenumbertrue 
transaction.product.prices[].currencyCurrency unitstringtrueFixed value: "JPY"
transaction.product.prices[].taxRatetax rate(%)numbertrue

Between 0 and 100.

transaction.product.languagelanguagestringtrueFixed value: "ja-JP"
transaction.product.titleName of Productstringtrue 
transaction.product.descriptionProduct description sentencestringtrue 
transaction.product.createdAtUNIX time stamp of the product of the creation date and timeintegertrue 
transcation.product.updatedAtUNIX time stamp of the product update date and time ofintegertrue 
transaction.quantityPurchase numberintegertrue 
transaction.totalPriceTax total purchase price objectobjecttrue 
transaction.totalPrice.valueTotal Pricenumbertrue 
transaction.totalPrice.currencyCurrency unitstringtrueFixed value: "JPY".
transaction.totalPrice.taxRatetax rate(%)numbertrueBetween 0 and 100.
transaction.stateThe state of the transactionstringtrueFixed value: "PURCHASED".
transaction.developerPayloadAny of the payload that has been specified by the developer at the time of payment requeststringtrue 
transaction.refundToTransaction ID of the refund destinationintegertrueFixed value: null
transaction.refundedByRefund the original transaction IDintegertrueFixed value: null
transaction.consumedAtUNIX time stamp of product consumption date and timeintegertrueFixed value: null
transaction.purchasedAtUNIX time stamp of payment fixed dateintegertrue 
transaction.createdAtUNIX time stamp of the transaction of the creation date and timeintegertrue 
transaction.updatedAtUNIX time stamp of the transaction update date and time ofintegertrue 
developerPayloadFields that developers can be any inputstringtrue

This length is between 0 and 4096. By default, it contains the "".

Response Example​

HTTP/1.1 200 OK
Content-Type: application/json

{
"iss": "https://sb-api.andapp.jp/1.0.0/payment",
"sub": "https://sb-api.andapp.jp/1.0.0/users/6104524",
"aud": "https://sb-api.andapp.jp/1.0.0/clients/189268204754",
"typ": "transaction_token",
"iat": 1464095267,
"exp": 1464096167,
"transaction": {
"id": 1234567890123456,
"clientId": 189268204754,
"userId": 1234567890123456,
"product": {
"id": "xxx.yyy.zzz.3000",
"clientId": 189268204754,
"type": "CONSUMABLE",
"state": "AVAILABLE",
"prices": [
{ "value": 3240, "currency": "JPY", "taxRate": 8 }
],
"language": "ja-JP",
"title": "Item Name",
"description": "Description of Item",
"createdAt": 1463468400,
"updatedAt": 1463468400
},
"quantity": 2,
"totalPrice": { "value": 6480, "currency": "JPY", "taxRate": 8 },
"state": "PURCHASED",
"developerPayload": "",
"refundTo": null,
"refundedBy": null,
"consumedAt": null,
"purchasedAt": 1463468400,
"createdAt": 1463468400,
"updatedAt": 1463468400
}
}

Error Response​

Error response will be returned in the application/problem+json format. The status code and the value of the type property of Problem Type is as follows.

statustitletypedescription
400Invalid JWT Formatabout:blank

The format of the transaction token is not JWT.

400Invalid JOSE Headerabout:blank

The JOSE Header of the transaction token is incorrect value.

400Invalid JWT Claimsabout:blank

The JWT Claims of the transaction token is illegal value.

403Signature is not verifiedabout:blank

The signature of the transaction token is invalid.

403Unexpected audienceabout:blank

The Client which calls this API and the Client represented by the aud claim of the transaction token are not same.

403Expired tokenabout:blank

The transaction token was already expired.

403

Withdrawal user

about:blank

The user is restricted.

500Server Errorabout:blank

The error occurs on the API server.

503Service Unavailableabout:blank

The API server can't answer temporary.

Error Response Example​

The example of an error response is as follows.

HTTP/1.1 400 Bad Request
Content-Type: application/problem+json

{
"type": "about:blank",
"title": "Bad Request",
"code": 400,
"instance": "https://sb-api.andapp.jp/1.0.0/payment/introspection"
}

Change log​

  • 2017/02/07
    • Added the maximum number of digits of the following
      • transaction.id

        transaction.clientId

        transaction.userId

        transaction.product.clientId

  • 2016/10/05
    • Description of transaction.clientId and transaction.userId in response body we added because it was missing.
    • Added descriptions of the transaction.clientId and transaction.userId on the Response Body section.
  • 2016/10/03
    • Added the error code when a user is restricted.
  • 2016/07/28
    • Create