Non-Instant Local Payment Methodsanchor

Requirementsanchor

  • In order to use this API, you must have created and linked your PayPal account with login credentials to the Braintree control panel.
CURRENCY REQUIREMENT

The PayPal account must be set up to transact in the same currency of the targeted funding source. OXXO: Mexican pesos (MXN), and Multibanco: European Union euro (EUR). Failure to do so will result in a validation error.

  • This API is available for all merchants to test in sandbox. For production usage, your account must be enabled to use this feature. Please contact Braintree Support for further assistance.

Creating Non-Instant Local Payment Contextsanchor

To create a non-instant local payment context, you will specify all relevant transaction information for that payment scheme.

Braintree currently supports the following non-instant payment schemes:

  • Multibanco
  • OXXO
  • Trustly

Fetching Non-Instant Local Payment Contextsanchor

See Fetching Local Payment Contexts page.

Capturing Non-Instant Transactionsanchor

There is no capture call for non-instant transactions; Braintree will associate a transaction on behalf of the merchant once we receive confirmation that the voucher has been paid.

SANDBOX

Use the approval url from the mutation response to display a modal in which you can simulate a successful payment, an expired payment, or an unapproved payment.

  • Successful payment: a webhook will be sent to the merchant in 2-3 minutes and the payment context will update to show an associated transaction in a settled state.
  • Expired payment: a webhook will be sent to the merchant in 2-3 minutes and the payment context will be expired.
  • Unapproved payment: the payment context will be expired.

Multibancoanchor

Required fields

  • amount - the amount of the order.
  • payerInfo/givenName - the given name of the buyer.
  • payerInfo/surname - the given surname of the buyer.
  • type - this must be MULTIBANCO.

Optional fields

  • orderId - this will be a merchant-generated identifier for the order.

Ignored fields

  • expiryDate - this value is not overridable; the value is always today + 7 days.
  1. Mutation
mutation CreateNonInstantLocalPaymentContext($input: CreateNonInstantLocalPaymentContextInput!) {
  createNonInstantLocalPaymentContext(input: $input) {
    paymentContext {
      id
      type
      paymentId
      approvalUrl
      merchantAccountId
      createdAt
      transactedAt
      approvedAt
      amount {
        value
        currencyCode
      }
    }
  }
}
  1. Variables
{
  "input": {
    "paymentContext": {
      "amount": {
        "value": 1.23,
        "currencyCode": "EUR"
      },
      "type": "MULTIBANCO",
      "countryCode": "PT",
      "returnUrl": "https://example.com/return",
      "cancelUrl": "https://example.com/cancel",
      "merchantAccountId": "a_merchant_account_id",
      "payerInfo": {
        "givenName": "John",
        "surname": "Doe"
      }
    }
  }
}
  1. Response
{
  "data": {
    "createNonInstantLocalPaymentContext": {
      "paymentContext": {
        "id": "a_payment_context_id",
        "type": "multibanco",
        "paymentId": "a_payment_id",
        "approvalUrl": "https://example.com/approval",
        "merchantAccountId": "a_merchant_account_id",
        "createdAt": "2021-07-28",
        "transactedAt": "2021-07-28",
        "approvedAt": "2021-07-28",
        "amount": {
          "value": 1.23,
          "currencyIsoCode": "EUR"
        }
    }
  },
  "extensions": {
    "requestId": "abc-123-def-456"
  }
}

OXXOanchor

Required fields

  • amount - the amount of the order.
  • payerInfo/billingAddress - the billing address of the buyer.
  • payerInfo/givenName - the given name of the buyer.
  • payerInfo/surname - the given surname of the buyer.
  • type - this must be OXXO.

Optional fields

  • expiryDate - if expiryDate is omitted, it will default to today + 3 days.
  • orderId - this will be a merchant-generated identifier for the order.
  1. Mutation
mutation CreateNonInstantLocalPaymentContext($input: CreateNonInstantLocalPaymentContextInput!) {
  createNonInstantLocalPaymentContext(input: $input) {
    paymentContext {
      id
      type
      paymentId
      approvalUrl
      merchantAccountId
      createdAt
      transactedAt
      approvedAt
      amount {
        value
        currencyCode
      }
    }
  }
}
  1. Variables
{
  "input": {
    "paymentContext": {
      "amount": {
        "value": 1.23,
        "currencyCode": "MXN"
      },
      "type": "OXXO",
      "countryCode": "MX",
      "returnUrl": "https://example.com/return",
      "cancelUrl": "https://example.com/cancel",
      "merchantAccountId": "a_merchant_account_id",
      "payerInfo": {
        "givenName": "John",
        "surname": "Doe",
        "email": "john.doe@example.com"
      }
    }
  }
}
  1. Response
{
  "data": {
    "createNonInstantLocalPaymentContext": {
      "paymentContext": {
        "id": "a_payment_context_id",
        "type": "oxxo",
        "paymentId": "a_payment_id",
        "approvalUrl": "https://example.com/approval",
        "merchantAccountId": "a_merchant_account_id",
        "createdAt": "2021-07-28",
        "transactedAt": "2021-07-28",
        "approvedAt": "2021-07-28",
        "amount": {
          "value": 1.23,
          "currencyIsoCode": "MXN"
        }
    }
  },
  "extensions": {
    "requestId": "abc-123-def-456"
  }
}

Trustlyanchor

Required fields

  • amount - the amount of the order.
  • payerInfo/email - the email of the buyer.
  • type - this must be TRUSTLY.

Optional fields

  • orderId - this will be a merchant-generated identifier for the order.

Ignored fields

  • expiryDate - this value is not overridable; the value is always today + 7 days.
  1. Mutation
mutation CreateNonInstantLocalPaymentContext($input: CreateNonInstantLocalPaymentContextInput!) {
  createNonInstantLocalPaymentContext(input: $input) {
    paymentContext {
      id
      type
      paymentId
      approvalUrl
      merchantAccountId
      createdAt
      transactedAt
      approvedAt
      amount {
        value
        currencyCode
      }
    }
  }
}
  1. Variables
{
  "input": {
    "paymentContext": {
      "amount": {
        "value": 10.22,
        "currencyCode": "EUR"
      },
      "type": "TRUSTLY",
      "countryCode": "DE",
      "returnUrl": "https://example.com/return",
      "cancelUrl": "https://example.com/cancel",
      "merchantAccountId": "a_merchant_account_id",
      "payerInfo": {
        "email": "test@example.com",
      }
    }
  }
}
  1. Response
{
  "data": {
    "createNonInstantLocalPaymentContext": {
      "paymentContext": {
        "id": "a_payment_context_id",
        "type": "trustly",
        "paymentId": "a_payment_id",
        "approvalUrl": "https://example.com/approval",
        "merchantAccountId": "a_merchant_account_id",
        "createdAt": "2021-07-28",
        "transactedAt": "2021-07-28",
        "approvedAt": "2021-07-28",
        "amount": {
          "value": 10.22,
          "currencyIsoCode": "EUR"
        }
    }
  },
  "extensions": {
    "requestId": "abc-123-def-456"
  }
}

Error Samplesanchor

General API error documentation

  1. JSON
{
  "errors": [
    {
      "message": "Presentment currency code USD is invalid for funding source trustly"
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "createNonInstantLocalPaymentContext"
      ],
      "extensions": {
        "errorClass": "VALIDATION",
        "errorType": "user_error",
        "inputPath": [
          "input",
          "paymentContext"
        ]
      }
    }
  ],
  "data": {
    "createNonInstantLocalPaymentContext": null
  },
  "extensions": {
    "requestId": "abc-123-def-456"
  }
}
  1. JSON
{
  "errors": [
    {
      "message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "createNonInstantLocalPaymentContext"
      ],
      "extensions": {
        "errorClass": "VALIDATION",
        "errorType": "user_error",
        "inputPath": [
          "input",
          "paymentContext"
        ]
      }
    }
  ],
  "data": {
    "createNonInstantLocalPaymentContext": null
  },
  "extensions": {
    "requestId": "abc-123-def-456"
  }
}