diff --git a/404.html b/404.html index 132986129..3f763d263 100644 --- a/404.html +++ b/404.html @@ -17,7 +17,7 @@ -

HTTP Status Codes

Centrapay APIs respond with 200, 400, 401, 403, 404, or 429 HTTP status codes. +

HTTP Status Codes

Centrapay APIs respond with 200, 400, 401, 403, 404, or 429 HTTP status codes. In rare cases endpoints may respond with 5xx status codes.

Some legacy or deprecated endpoints may have exceptions to the guidelines documented here. Any such exceptions will be documented on the endpoints.

@@ -54,6 +54,7 @@
  • Check your HTTP verb is correct (POST, PUT, GET etc.).
  • Check query parameters are set correctly.
  • Check path parameters are set correctly.
  • +
  • Make sure your object IDs  API  have the correct prefix if present.
  • API key or JWT is missing, expired or invalid. Go look at our Auth  API  documentation.

    diff --git a/api/integration-requests/index.html b/api/integration-requests/index.html index 2588c735e..b811c5656 100644 --- a/api/integration-requests/index.html +++ b/api/integration-requests/index.html @@ -19,7 +19,7 @@

    Merchant Configs

    A Merchant Config defines the available payment options for paying a Payment Request  API .

    +

    Merchant Configs

    A Merchant Config defines the available payment options for paying a Payment Request  API .

    Attributes

    Response
    {
    -  "id": "5ee168e8597be5002af7b454",
    +  "id": "mc_5ee168e8597be5002af7b454",
       "merchantId": "5ee0c486308f590260d9a07f",
       "createdAt": "2021-11-12T01:17:46.499Z",
       "updatedAt": "2021-11-12T01:17:46.499Z",
    @@ -103,7 +103,7 @@
      -H 'x-api-key: <TOKEN>'
    Response
    {
    -  "id": "5ee168e8597be5002af7b454",
    +  "id": "mc_5ee168e8597be5002af7b454",
       "merchantId": "5ee0c486308f590260d9a07f",
       "createdAt": "2021-11-12T01:17:46.499Z",
       "updatedAt": "2021-11-12T01:17:46.499Z",
    @@ -125,7 +125,7 @@
     Copy
     
    Response
    [
       {
    -    "id": "5ee168e8597be5002af7b454",
    +    "id": "mc_5ee168e8597be5002af7b454",
         "merchantId": "5ee0c486308f590260d9a07f",
         "createdAt": "2021-09-12T01:17:46.499Z",
         "updatedAt": "2021-09-12T01:17:46.499Z",
    @@ -139,7 +139,7 @@
         ]
       },
       {
    -    "id": "5ee168e8597be5002af7baed",
    +    "id": "mc_5ee168e8597be5002af7baed",
         "merchantId": "5ee0c486308f590260d9a07f",
         "createdAt": "2021-11-12T01:17:46.499Z",
         "updatedAt": "2021-11-12T01:17:46.499Z",
    @@ -159,8 +159,8 @@
     Collapse all
     
    • paymentOptions

      arrayrequired
    • allowedRedirectUrls

      arrayexperimental

      Allowed prefixes for the redirectUrl property on Payment Requests created with this Config.

    Errors

    Request
    PUT/api/merchants/5ee0c486308f590260d9a07f/configs/5ee168e8597be5002af7baed
    curl -X PUT \
    - https://service.centrapay.com/api/merchants/5ee0c486308f590260d9a07f/configs/5ee168e8597be5002af7baed \
    +
    Request
    PUT/api/merchants/5ee0c486308f590260d9a07f/configs/mc_5ee168e8597be5002af7baed
    curl -X PUT \
    + https://service.centrapay.com/api/merchants/5ee0c486308f590260d9a07f/configs/mc_5ee168e8597be5002af7baed \
      -H 'content-type: application/json' \
      -H 'x-api-key: <TOKEN>' \
      -d '
    @@ -182,7 +182,7 @@
     '
    Response
    {
    -  "id": "5ee168e8597be5002af7baed",
    +  "id": "mc_5ee168e8597be5002af7baed",
       "merchantId": "5ee0c486308f590260d9a07f",
       "createdAt": "2021-09-12T01:17:46.499Z",
       "updatedAt": "2021-12-12T01:17:46.499Z",
    diff --git a/api/merchants/index.html b/api/merchants/index.html
    index 7e24b2ce0..490a0aadd 100644
    --- a/api/merchants/index.html
    +++ b/api/merchants/index.html
    @@ -19,7 +19,7 @@
     
     
    + + + + +

    Object IDs

    Centrapay uses identifiers (IDs) to uniquely distinguish objects within our system. Object IDs are alphanumeric strings with an optional prefix. +Prefixes enhance readability and allow Centrapay to immediately return errors  API  to integrators when an invalid ID is used.

    +
    +

    Objects with prefixes will conform to the format {prefix}_{random-characters} e.g. mc_3LKQhvGUcADgqoEM3bh6pslE.

    +
    + + + + + + + + + + + + + + + + + +
    PrefixDescription
    mc_Identifier for a Merchant Config  API  object.
    c_Identifier for a Collection  API  object.
    \ No newline at end of file diff --git a/api/pagination/index.html b/api/pagination/index.html index 6124f474e..0e0c1b51a 100644 --- a/api/pagination/index.html +++ b/api/pagination/index.html @@ -19,7 +19,7 @@

    Payment Requests

    Payment Requests represent the intention for a merchant to receive payment for goods and services. Payment Requests define the amount to be paid and the Asset Types that are acceptable for payment.

    +

    Payment Requests

    Payment Requests represent the intention for a merchant to receive payment for goods and services. Payment Requests define the amount to be paid and the Asset Types that are acceptable for payment.

    A Payment Request is shared with, and paid by, a patron. The Payment Flows Guide has more details regarding negotiation of Payment Requests.

    Payment Requests have the following statuses:

    Response
    {
    -  "id": "Xv990BzkgfoDS7bBls50pd",
    +  "id": "c_Xv990BzkgfoDS7bBls50pd",
       "name": "Bread",
       "accountId": "T3y6hogYA4d612BExypWYH",
       "tokenExpiresAfter": {
    @@ -121,7 +121,7 @@
       "nextPageKey": "Collection#E9eXsErwA444qFDoZt5iLA|#Collection",
       "items": [
         {
    -      "id": "Xv990BzkgfoDS7bBls50pd",
    +      "id": "c_Xv990BzkgfoDS7bBls50pd",
           "name": "Bread",
           "accountId": "T3y6hogYA4d612BExypWYH",
           "tokenExpiresAfter": {
    @@ -150,8 +150,8 @@
     Collapse all
     
    • merchantId

      string

      The identifier of the Merchant  API  that is accepting the collection.

    • allowedProducts

      object

      List of Allowed Products. Required for collections of type product.

    Errors

    • INVALID_AMOUNT

      403

      One or more of the maxValue amount in the products has exceeded the maxValue amount defined on the collection.

    • REDEMPTION_CONDITION_ALREADY_EXISTS

      403

      A redemption condition for the collection and the merchant has already been created.

    Request
    POST/api/collections/NFhUgPQEYbk2EbTXAYArTX/redemption-conditions
    curl -X POST \
    - https://service.centrapay.com/api/collections/NFhUgPQEYbk2EbTXAYArTX/redemption-conditions \
    +
    • INVALID_AMOUNT

      403

      One or more of the maxValue amount in the products has exceeded the maxValue amount defined on the collection.

    • REDEMPTION_CONDITION_ALREADY_EXISTS

      403

      A redemption condition for the collection and the merchant has already been created.

    Request
    POST/api/collections/c_NFhUgPQEYbk2EbTXAYArTX/redemption-conditions
    curl -X POST \
    + https://service.centrapay.com/api/collections/c_NFhUgPQEYbk2EbTXAYArTX/redemption-conditions \
      -H 'content-type: application/json' \
      -H 'x-api-key: <TOKEN>' \
      -d '
    @@ -181,7 +181,7 @@
     
    Response
    {
       "id": "1234",
       "merchantId": "36EALpZ89XpShxM2Ee9sXT",
    -  "collectionId": "NFhUgPQEYbk2EbTXAYArTX",
    +  "collectionId": "c_NFhUgPQEYbk2EbTXAYArTX",
       "allowedProducts": [
         {
           "sku": "100001",
    @@ -216,7 +216,7 @@
      -H 'x-api-key: <TOKEN>' \
      -d '
     {
    - "collectionId": "Jaim1Cu1Q55uooxSens6yk",
    + "collectionId": "c_Jaim1Cu1Q55uooxSens6yk",
      "idempotencyKey": "payment-de32dd90-b46c-11ea-93c3-83a333b86e7b",
      "externalId": "23403283262"
     }
    @@ -226,7 +226,7 @@
       "id": "pe32dd90-b46c-11ea-92828sa",
       "accountId": "WRhAxxWpTKb5U7pXyxQjjP",
       "category": "token",
    -  "collectionId": "Jaim1Cu1Q55uooxSens6yk",
    +  "collectionId": "c_Jaim1Cu1Q55uooxSens6yk",
       "status": "active",
       "createdAt": "2021-01-17T18:00:23.000Z",
       "activeFrom": "2021-01-17T18:00:23.000Z",
    diff --git a/api/wallets/index.html b/api/wallets/index.html
    index aa7081642..b0758a7b0 100644
    --- a/api/wallets/index.html
    +++ b/api/wallets/index.html
    @@ -19,7 +19,7 @@
     
     

    Guides -

    Creating Digital Tokens

    Digital tokens are assets that can be exchanged for specific products or deals. Think a “Free coffee” coupon or a “50% off” voucher. +

    Creating Digital Tokens

    Digital tokens are assets that can be exchanged for specific products or deals. Think a “Free coffee” coupon or a “50% off” voucher. Unlike assets such as gift cards or currency, tokens can only be spent in their entirety, all at once.

    Token Collection

    A collection is a grouping of tokens that share the same attributes and redemption conditions, e.g.

    @@ -85,7 +85,7 @@
  • Create Redemption Condition for each merchant, using the collection Id from step 1

    Redemption Conditions are created by calling the Create Redemption Condition  API  endpoint. You will need the merchant identifier for the merchantId field. The list of allowedProducts defines those products sold by the merchant that are eligible for redemption. The sku for the product will need to match the sku that is passed in with the line item when the merchant creates the payment during redemption: Create Payment Request  API .

    -
    Request
    POST/api/collections/{collectionId}/redemption-conditions
    curl -X POST https://service.centrapay.com/api/collections/NFhUgPQEYbk2EbTXAYArTX/redemption-conditions \
    +
    Request
    POST/api/collections/{collectionId}/redemption-conditions
    curl -X POST https://service.centrapay.com/api/collections/c_NFhUgPQEYbk2EbTXAYArTX/redemption-conditions \
       -H "X-Api-Key: $api_key" \
       -H "Content-Type: application/json" \
       -d '{
    @@ -119,7 +119,7 @@
       -H "X-Api-Key: $api_key" \
       -H "Content-Type: application/json" \
       -d '{
    -    "collectionId": "NFhUgPQEYbk2EbTXAYArTX",
    +    "collectionId": "c_NFhUgPQEYbk2EbTXAYArTX",
         "idempotencyKey": "token-de32dd90-b46c-11ea-93c3-83a333b86e7b"
       }'