> ## Documentation Index
> Fetch the complete documentation index at: https://docs.salesive.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get payment config

> Retrieve the initialization payload for a configured payment method.

## Request

```http theme={null}
GET /payments/config/{provider}?orderId={{orderId}}
Authorization: Bearer {{token}}
x-shop-id: {{shopId}}
```

## Path parameters

| Parameter  | Type   | Description                                                                                                                               |
| ---------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `provider` | string | The **ShopPayment id** (from [`GET /payments`](/api-reference/endpoint/payments/get-payments)), not a provider name such as `"paystack"`. |

## Query parameters

| Parameter  | Type   | Description                                             |
| ---------- | ------ | ------------------------------------------------------- |
| `orderId`  | string | **Required.** The order the payment is initialized for. |
| `currency` | string | Optional. Defaults to the shop currency (e.g. `NGN`).   |

<Note>
  The `provider` segment must be a valid 24-character ShopPayment id. Passing a
  provider name (for example `paystack`) returns `400`. List the available
  payment methods and their ids with `GET /payments`.
</Note>

## Successful response

The shape of `data` depends on the payment method `type`. A bank-transfer
method returns account details:

```json theme={null}
{
    "status": 200,
    "success": true,
    "message": "Payment config retrieved",
    "data": {
        "accountNumber": "1234567890",
        "accountName": "Sample Store / Jane Smith",
        "bankCode": "035",
        "bankName": "Wema Bank",
        "bankId": "wema"
    }
}
```

A gateway method (e.g. Nomba) returns the gateway initialization payload
(`accountId`, `clientId`, and an `order` object with the amount and metadata).

## Error responses

```json theme={null}
{
    "status": 400,
    "success": false,
    "message": "\"provider\" length must be 24 characters long",
    "data": {}
}
```

```json theme={null}
{
    "status": 500,
    "success": false,
    "message": "This payment provider is not enabled for this store",
    "data": null
}
```


## OpenAPI

````yaml GET /payments/config/{provider}
openapi: 3.1.0
info:
  title: Salesive Store API
  description: >-
    REST interface for querying products, categories, and merchandising banners
    exposed by Salesive storefronts.
  version: 1.0.0
servers:
  - description: Production
    url: https://store.salesive.com/api/v1
security:
  - BearerAuth: []
    ShopIdHeader: []
paths:
  /payments/config/{provider}:
    get:
      summary: Get payment config for a provider
      description: >-
        Return the initialization payload for a configured payment method.
        `provider` is the **ShopPayment id** returned by `GET /payments` (not a
        provider name). Requires an `orderId`.
      parameters:
        - $ref: '#/components/parameters/XShopIdHeader'
        - name: provider
          in: path
          required: true
          description: ShopPayment id from GET /payments.
          schema:
            type: string
        - name: orderId
          in: query
          required: true
          schema:
            type: string
        - name: currency
          in: query
          required: false
          schema:
            type: string
            example: NGN
      responses:
        '200':
          description: Payment config retrieved.
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid provider id.
        '404':
          description: Provider not enabled or order not found.
components:
  parameters:
    XShopIdHeader:
      name: x-shop-id
      in: header
      description: >-
        Optional identifier that scopes responses to a specific storefront when
        the referer cannot be inferred.
      required: false
      schema:
        type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT issued by the Salesive Store API for authenticated shoppers.
    ShopIdHeader:
      type: apiKey
      in: header
      name: x-shop-id
      description: >-
        Optional storefront identifier sent as a header to scope responses to a
        specific shop. Try It requests remember this value once provided.

````